1 Initial Setup

Items in this section are advised for all systems, but may be difficult or require extensive preparation after the initial setup of the system.

1.1 Filesystem Configuration

Directories that are used for system-wide functions can be further protected by placing them on separate partitions. This provides protection for resource exhaustion and enables the use of mounting options that are applicable to the directory's intended use. Users' data can be stored on separate partitions and have stricter mount options. A user partition is a filesystem that has been established for use by the users and does not contain software for system operations.

The recommendations in this section are easier to perform during initial system installation. If the system is already installed, it is recommended that a full backup be performed before repartitioning the system.

Note: If you are repartitioning a system that has already been installed, make sure the data has been copied over to the new partition, unmount it and then remove the data from the directory that was in the old partition. Otherwise it will still consume space in the old partition that will be masked when the new filesystem is mounted. For example, if a system is in single-user mode with no filesystems mounted and the administrator adds a lot of data to the /tmp directory, this data will still consume space in / once the /tmp filesystem is mounted unless it is removed first.

1.1.1 Disable unused filesystems

A number of uncommon filesystem types are supported under Linux. Removing support for unneeded filesystem types reduces the local attack surface of the system. If a filesystem type is not needed it should be disabled. Native Linux file systems are designed to ensure that built-in security controls function as expected. Non-native filesystems can lead to unexpected consequences to both the security and functionality of the system and should be used with caution. Many filesystems are created for niche use cases and are not maintained and supported as the operating systems are updated and patched. Users of non-native filesystems should ensure that there is attention and ongoing support for them, especially in light of frequent operating system changes.

Standard network connectivity and Internet access to cloud storage may make the use of non-standard filesystem formats to directly attach heterogeneous devices much less attractive.

Note : This should not be considered a comprehensive list of filesystems. You may wish to consider additions to those listed here for your environment.

1.1.1.1 Ensure mounting of cramfs filesystems is disabled

Description:

The cramfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems. A cramfs image can be used without having to first decompress the image.

Removing support for unneeded filesystem types reduces the local attack surface of the server. If this filesystem type is not needed, disable it.

Edit or create a file in the /etc/modprobe.d/ directory ending in .conf

Example: vi /etc/modprobe.d/cramfs.conf

and add the following line:

install cramfs /bin/true

Run the following command to unload the cramfs module:

# rmmod cramfs

References:

Back to Summary

1.1.1.2 Ensure mounting of freevxfs filesystems is disabled

Description:

The freevxfs filesystem type is a free version of the Veritas type filesystem. This is the primary filesystem type for HP-UX operating systems.

Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it.

Edit or create a file in the /etc/modprobe.d/ directory ending in .conf

Example: vi /etc/modprobe.d/freevxfs.conf

and add the following line:

install freevxfs /bin/true

Run the following command to unload the freevxfs module:

rmmod freevxfs

References:

Back to Summary

1.1.1.3 Ensure mounting of jffs2 filesystems is disabled

Description:

The jffs2 (journaling flash filesystem 2) filesystem type is a log-structured filesystem used in flash memory devices.

Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it.

Edit or create a file in the /etc/modprobe.d/ directory ending in .conf

Example: vi /etc/modprobe.d/jffs2.conf

and add the following line:

install jffs2 /bin/true

Run the following command to unload the jffs2 module:

# rmmod jffs2

References:

Back to Summary

1.1.1.4 Ensure mounting of hfs filesystems is disabled

Description:

The hfs filesystem type is a hierarchical filesystem that allows you to mount Mac OS filesystems.

Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it.

Edit or create a file in the /etc/modprobe.d/ directory ending in .conf

Example: vi /etc/modprobe.d/hfs.conf

and add the following line:

install hfs /bin/true

Run the following command to unload the hfs module:

# rmmod hfs

References:

Back to Summary

1.1.1.5 Ensure mounting of hfsplus filesystems is disabled

Description:

The hfsplus filesystem type is a hierarchical filesystem designed to replace hfs that allows you to mount Mac OS filesystems.

Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it.

Edit or create a file in the /etc/modprobe.d/ directory ending in .conf

Example: vi /etc/modprobe.d/hfsplus.conf

and add the following line:

install hfsplus /bin/true

Run the following command to unload the hfsplus module:

# rmmod hfsplus

References:

Back to Summary

1.1.1.6 Ensure mounting of squashfs filesystems is disabled

Description:

The squashfs filesystem type is a compressed read-only Linux filesystem embedded in small footprint systems (similar to cramfs ). A squashfs image can be used without having to first decompress the image.

Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it.

Edit or create a file in the /etc/modprobe.d/ directory ending in .conf

Example: vi /etc/modprobe.d/squashfs.conf

and add the following line:

install squashfs /bin/true

Run the following command to unload the squashfs module:

# rmmod squashfs

References:

Back to Summary

1.1.1.7 Ensure mounting of udf filesystems is disabled

Description:

The udf filesystem type is the universal disk format used to implement ISO/IEC 13346 and ECMA-167 specifications. This is an open vendor filesystem type for data storage on a broad range of media. This filesystem type is necessary to support writing DVDs and newer optical disc formats.

Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it.

Edit or create a file in the /etc/modprobe.d/ directory ending in .conf

Example: vi /etc/modprobe.d/udf.conf

and add the following line:

install udf /bin/true

Run the following command to unload the udf module:

# rmmod udf

References:

Back to Summary

1.1.1.8 Ensure mounting of FAT filesystems is limited

Description:

The FAT filesystem format is primarily used on older windows systems and portable USB drives or flash modules. It comes in three types FAT12 , FAT16 , and FAT32 all of which are supported by the vfat kernel module.

Removing support for unneeded filesystem types reduces the local attack surface of the system. If this filesystem type is not needed, disable it.

Edit or create a file in the /etc/modprobe.d/ directory ending in .conf

Example: vi /etc/modprobe.d/vfat.conf

install vfat /bin/true

Run the following command to unload the vfat module:

# rmmod vfat

Impact:

The FAT filesystem format is used by UEFI systems for the EFI boot partition. Disabling the vfat module can prevent boot on UEFI systems.

FAT filesystems are often used on portable USB sticks and other flash media which are commonly used to transfer files between workstations, removing VFAT support may prevent the ability to transfer files in this way.

References:

Back to Summary

1.1.2 Ensure /tmp is configured

Description:

The /tmp directory is a world-writable directory used for temporary storage by all users and some applications.

Making /tmp its own file system allows an administrator to set the noexec option on the mount, making /tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw.

This can be accomplished by either mounting tmpfs to /tmp, or creating a separate partition for /tmp.

Configure /etc/fstab as appropriate.

Example:

tmpfs /tmp tmpfs defaults,rw,nosuid,nodev,noexec,relatime 0 0

OR

Run the following commands to enable systemd /tmp mounting:

systemctl unmask tmp.mount
systemctl enable tmp.mount

Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to configure the /tmp mount:

[Mount]
What=tmpfs
Where=/tmp
Type=tmpfs
Options=mode=1777,strictatime,noexec,nodev,nosuid

Impact:

Since the /tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition.

Running out of /tmp space is a problem regardless of what kind of filesystem lies under it, but in a default installation a disk-based /tmp will essentially have the whole disk available, as it only creates a single / partition. On the other hand, a RAM-based /tmp as with tmpfs will almost certainly be much smaller, which can lead to applications filling up the filesystem much more easily.

/tmp utalizing tmpfs can be resized using the size={size} parameter on the Options line on the tmp.mount file

References:

Back to Summary

1.1.3 Ensure nodev option set on /tmp partition

Description:

The nodev mount option specifies that the filesystem cannot contain special devices.

Since the /tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /tmp .

Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information.

Run the following command to remount /tmp :

# mount -o remount,nodev /tmp

OR If systemd tmp.mount is configured:

Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nodev to the /tmp mount options:

[Mount]
Options=mode=1777,strictatime,noexec,nodev,nosuid

Run the following command to remount /tmp :

# mount -o remount,nodev /tmp

References:

Back to Summary

1.1.4 Ensure nosuid option set on /tmp partition

Description:

The nosuid mount option specifies that the filesystem cannot contain setuid files.

Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /tmp .

Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information.

Run the following command to remount /tmp :

# mount -o remount,nosuid /tmp

or

Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add nosuid to the /tmp mount options:

[Mount]
Options=mode=1777,strictatime,noexec,nodev,nosuid

Run the following command to remount /tmp :

# mount -o remount,nosuid /tmp

References:

Back to Summary

1.1.5 Ensure noexec option set on /tmp partition

Description:

The noexec mount option specifies that the filesystem cannot contain executable binaries.

Since the /tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /tmp .

Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /tmp partition. See the fstab(5) manual page for more information.

Run the following command to remount /tmp :

# mount -o remount,noexec /tmp

or

Edit /etc/systemd/system/local-fs.target.wants/tmp.mount to add noexec to the /tmp mount options:

[Mount]
Options=mode=1777,strictatime,noexec,nodev,nosuid

Run the following command to remount /tmp :

# mount -o remount,noexec /tmp

References:

Back to Summary

1.1.6 Ensure separate partition exists for /var

Description:

The /var directory is used by daemons and other system services to temporarily store dynamic data. Some directories created by these processes may be world-writable.

Since the /var directory may contain world-writable files and directories, there is a risk of resource exhaustion if it is not bound to a separate partition.

For new installations, during installation create a custom partition setup and specify a separate partition for /var .

For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate.

Impact:

Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations.

References:

Back to Summary

1.1.7 Ensure separate partition exists for /var/tmp

Description:

The /var/tmp directory is a world-writable directory used for temporary storage by all users and some applications.

Since the /var/tmp directory is intended to be world-writable, there is a risk of resource exhaustion if it is not bound to a separate partition. In addition, making /var/tmp its own file system allows an administrator to set the noexec option on the mount, making /var/tmp useless for an attacker to install executable code. It would also prevent an attacker from establishing a hardlink to a system setuid program and wait for it to be updated. Once the program was updated, the hardlink would be broken and the attacker would have his own copy of the program. If the program happened to have a security vulnerability, the attacker could continue to exploit the known flaw.

For new installations, during installation create a custom partition setup and specify a separate partition for /var/tmp .

For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate.

Impact:

Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations.

References:

Back to Summary

1.1.8 Ensure nodev option set on /var/tmp partition

Description:

The nodev mount option specifies that the filesystem cannot contain special devices.

Since the /var/tmp filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices in /var/tmp .

Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information.

Run the following command to remount /var/tmp :

# mount -o remount,nodev /var/tmp

References:

Back to Summary

1.1.9 Ensure nosuid option set on /var/tmp partition

Description:

The nosuid mount option specifies that the filesystem cannot contain setuid files.

Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot create setuid files in /var/tmp .

Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information.

Run the following command to remount /var/tmp :

# mount -o remount,nosuid /var/tmp

References:

Back to Summary

1.1.10 Ensure noexec option set on /var/tmp partition

Description:

The noexec mount option specifies that the filesystem cannot contain executable binaries.

Since the /var/tmp filesystem is only intended for temporary file storage, set this option to ensure that users cannot run executable binaries from /var/tmp .

Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /var/tmp partition. See the fstab(5) manual page for more information.

Run the following command to remount /var/tmp :

# mount -o remount,noexec /var/tmp

References:

Back to Summary

1.1.11 Ensure separate partition exists for /var/log

Description:

The /var/log directory is used by system services to store log data .

There are two important reasons to ensure that system logs are stored on a separate partition: protection against resource exhaustion (since logs can grow quite large) and protection of audit data.

For new installations, during installation create a custom partition setup and specify a separate partition for /var/log .

For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate.

Impact:

Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations.

References:

Back to Summary

1.1.12 Ensure separate partition exists for /var/log/audit

Description:

The auditing daemon, auditd , stores log data in the /var/log/audit directory.

There are two important reasons to ensure that data gathered by auditd is stored on a separate partition: protection against resource exhaustion (since the audit.log file can grow quite large) and protection of audit data. The audit daemon calculates how much free space is left and performs actions based on the results. If other processes (such as syslog ) consume space in the same partition as auditd , it may not perform as desired.

For new installations, during installation create a custom partition setup and specify a separate partition for /var/log/audit .

For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate.

Impact:

Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations.

References:

Back to Summary

1.1.13 Ensure separate partition exists for /home

Description:

The /home directory is used to support disk storage needs of local users.

If the system is intended to support local users, create a separate partition for the /home directory to protect against resource exhaustion and restrict the type of files that can be stored under /home .

For new installations, during installation create a custom partition setup and specify a separate partition for /home .

For systems that were previously installed, create a new partition and configure /etc/fstab as appropriate.

Impact:

Resizing filesystems is a common activity in cloud-hosted servers. Separate filesystem partitions may prevent successful resizing, or may require the installation of additional tools solely for the purpose of resizing operations. The use of these additional tools may introduce their own security considerations.

References:

Back to Summary

1.1.14 Ensure nodev option set on /home partition

Description:

The nodev mount option specifies that the filesystem cannot contain special devices.

Since the user partitions are not intended to support devices, set this option to ensure that users cannot attempt to create block or character special devices.

Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /home partition. See the fstab(5) manual page for more information.

# mount -o remount,nodev /home

References:

Back to Summary

1.1.15 Ensure nodev option set on /dev/shm partition

Description:

The nodev mount option specifies that the filesystem cannot contain special devices.

Since the /dev/shm filesystem is not intended to support devices, set this option to ensure that users cannot attempt to create special devices in /dev/shm partitions.

Edit the /etc/fstab file and add nodev to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information.

Run the following command to remount /dev/shm :

# mount -o remount,nodev /dev/shm

References:

Back to Summary

1.1.16 Ensure nosuid option set on /dev/shm partition

Description:

The nosuid mount option specifies that the filesystem cannot contain setuid files.

Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them.

Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information.

Run the following command to remount /dev/shm :

# mount -o remount,nosuid /dev/shm

References:

Back to Summary

1.1.17 Ensure noexec option set on /dev/shm partition

Description:

The noexec mount option specifies that the filesystem cannot contain executable binaries.

Setting this option on a file system prevents users from executing programs from shared memory. This deters users from introducing potentially malicious software on the system.

Edit the /etc/fstab file and add noexec to the fourth field (mounting options) for the /dev/shm partition. See the fstab(5) manual page for more information.

Run the following command to remount /dev/shm :

# mount -o remount,noexec /dev/shm

References:

Back to Summary

1.1.18 Ensure nodev option set on removable media partitions

Description:

The nodev mount option specifies that the filesystem cannot contain special devices.

Removable media containing character and block special devices could be used to circumvent security controls by allowing non-root users to access sensitive device files such as /dev/kmem or the raw disk partitions.

Edit the /etc/fstab file and add nodev to the fourth field (mounting options) of all removable media partitions. Look for entries that have mount points that contain words such as floppy or cdrom. See the fstab(5) manual page for more information.

References:

Back to Summary

1.1.19 Ensure nosuid option set on removable media partitions

Description:

The nosuid mount option specifies that the filesystem cannot contain setuid files.

Setting this option on a file system prevents users from introducing privileged programs onto the system and allowing non-root users to execute them.

Edit the /etc/fstab file and add nosuid to the fourth field (mounting options) of all removable media partitions. Look for entries that have mount points that contain words such as floppy or cdrom. See the fstab(5) manual page for more information.

References:

Back to Summary

1.1.20 Ensure noexec option set on removable media partitions

Description:

The noexec mount option specifies that the filesystem cannot contain executable binaries.

Setting this option on a file system prevents users from executing programs from the removable media. This deters users from being able to introduce potentially malicious software on the system.

Edit the /etc/fstab file and add noexec to the fourth field (mounting options) of all removable media partitions. Look for entries that have mount points that contain words such as floppy or cdrom. See the fstab(5) manual page for more information.

References:

Back to Summary

1.1.21 Ensure sticky bit is set on all world-writable directories

Description:

Setting the sticky bit on world writable directories prevents users from deleting or renaming files in that directory that are not owned by them.

This feature prevents the ability to delete or rename files in world writable directories (such as /tmp ) that are owned by another user.

Run the following command to set the sticky bit on all world writable directories:

# df --local -P | awk '{if (NR!=1) print $6}' | xargs -I '{}' find '{}' -xdev -type d \( -perm -0002 -a ! -perm -1000 \) 2>/dev/null | xargs -I '{}' chmod a+t '{}'

References:

Back to Summary

1.1.22 Disable Automounting

Description:

autofs allows automatic mounting of devices, typically including CD/DVDs and USB drives.

With automounting enabled anyone with physical access could attach a USB drive or disc and have its contents available in system even if they lacked permissions to mount it themselves.

Run one of the following commands:

Run the following command to disable autofs :

# systemctl --now disable autofs

OR

Run the following command to remove autofs

# apt purge autofs

Impact:

The use of portable hard drives is very common for workstation users. If your organization allows the use of portable storage or media on workstations and physical access controls to workstations is considered adequate there is little value add in turning off automounting.

References:

Back to Summary

1.1.23 Disable USB Storage

Description:

USB storage provides a means to transfer and store files insuring persistence and availability of the files independent of network connection status. Its popularity and utility has led to USB-based malware being a simple and common means for network infiltration and a first step to establishing a persistent threat within a networked environment.

Restricting USB access on the system will decrease the physical attack surface for a device and diminish the possible vectors to introduce malware.

Edit or create a file in the /etc/modprobe.d/ directory ending in .conf

Example: vi /etc/modprobe.d/usb_storage.conf and add the following line:

install usb-storage /bin/true

Run the following command to unload the usb-storage module:

rmmod usb-storage

References:

Back to Summary

1.2 Configure Software Updates

Ubuntu Linux use apt to install and update software packages. Patch management procedures may vary widely between enterprises. Large enterprises may choose to install a local updates server that can be used in place of their distributions servers, whereas a single deployment of a system may prefer to get updates directly. Updates can be performed automatically or manually, depending on the site's policy for patch management. Many large enterprises prefer to test patches on a non-production system before rolling out to production.

For the purpose of this benchmark, the requirement is to ensure that a patch management system is configured and maintained. The specifics on patch update procedures are left to the organization.

1.2.1 Ensure package manager repositories are configured

Description:

Systems need to have package manager repositories configured to ensure they receive the latest patches and updates.

If a system's package repositories are misconfigured important patches may not be identified or a rogue repository could introduce compromised software.

Configure your package manager repositories according to site policy.

References:

Back to Summary

1.2.2 Ensure GPG keys are configured

Description:

Most packages managers implement GPG key signing to verify package integrity during installation.

It is important to ensure that updates are obtained from a valid source to protect against spoofing that could lead to the inadvertent installation of malware on the system.

Update your package manager GPG keys in accordance with site policy.

References:

Back to Summary

1.3 Configure sudo

sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy.

sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers.

1.3.1 Ensure sudo is installed

Description:

sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy. The invoking user's real (not effective) user ID is used to determine the user name with which to query the security policy.

sudo supports a plugin architecture for security policies and input/output logging. Third parties can develop and distribute their own policy and I/O logging plugins to work seamlessly with the sudo front end. The default security policy is sudoers, which is configured via the file /etc/sudoers.

The security policy determines what privileges, if any, a user has to run sudo. The policy may require that users authenticate themselves with a password or another authentication mechanism. If authentication is required, sudo will exit if the user's password is not entered within a configurable time limit. This limit is policy-specific.

Install sudo using the following command.

# apt install sudo

OR

# apt install sudo-ldap

References:

Back to Summary

1.3.2 Ensure sudo commands use pty

Description:

sudo can be configured to run only from a psuedo-pty

Attackers can run a malicious program using sudo, which would again fork a background process that remains even when the main program has finished executing.

edit the file /etc/sudoers or a file in /etc/sudoers.d/ and add the following line:

Defaults use_pty

References:

Back to Summary

1.3.3 Ensure sudo log file exists

Description:

sudo can use a custom log file

A sudo log file simplifies auditing of sudo commands

edit the file /etc/sudoers or a file in /etc/sudoers.d/ and add the following line:

Defaults logfile="<PATH TO CUSTOM LOG FILE>"

Example

Defaults logfile="/var/log/sudo.log"

References:

Back to Summary

1.4 Filesystem Integrity Checking

AIDE is a file integrity checking tool, similar in nature to Tripwire. While it cannot prevent intrusions, it can detect unauthorized changes to configuration files by alerting when the files are changed. When setting up AIDE, decide internally what the site policy will be concerning integrity checking. Review the AIDE quick start guide and AIDE documentation before proceeding.

1.4.1 Ensure AIDE is installed

Description:

AIDE takes a snapshot of filesystem state including modification times, permissions, and file hashes which can then be used to compare against the current state of the filesystem to detect modifications to the system.

By monitoring the filesystem state compromised files can be detected to prevent or limit the exposure of accidental or malicious misconfigurations or modified binaries.

Install AIDE using the appropriate package manager or manual installation:

# apt install aide aide-common

Configure AIDE as appropriate for your environment. Consult the AIDE documentation for options.

Initialize AIDE:

# aideinit

References:

Back to Summary

1.4.2 Ensure filesystem integrity is regularly checked

Description:

Periodic checking of the filesystem integrity is needed to detect changes to the filesystem.

Periodic file checking allows the system administrator to determine on a regular basis if critical files have been changed in an unauthorized fashion.

Run the following commands:

# cp ./config/aidecheck.service /etc/systemd/system/aidecheck.service # cp ./config/aidecheck.timer /etc/systemd/system/aidecheck.timer # chmod 0644 /etc/systemd/system/aidecheck.* # systemctl reenable aidecheck.timer # systemctl restart aidecheck.timer # systemctl daemon-reload

ORRun the following command:

# crontab -u root -e

Add the following line to the crontab:

0 5 * * * /usr/bin/aide.wrapper --config /etc/aide/aide.conf --check

References:

Back to Summary

1.5 Secure Boot Settings

The recommendations in this section focus on securing the bootloader and settings involved in the boot process directly.

1.5.1 Ensure permissions on bootloader config are configured

Description:

The grub configuration file contains information on boot settings and passwords for unlocking boot options. The grub configuration is usually grub.cfg stored in /boot/grub/ .

Setting the permissions to read and write for root only prevents non-root users from seeing the boot parameters or changing them. Non-root users who read the boot parameters may be able to identify weaknesses in security upon boot and be able to exploit them.

Run the following commands to set permissions on your grub configuration:

# chown root:root /boot/grub/grub.cfg # chmod og-rwx /boot/grub/grub.cfg

References:

Back to Summary

1.5.2 Ensure bootloader password is set

Description:

Setting the boot loader password will require that anyone rebooting the system must enter a password before being able to set command line boot parameters

Requiring a boot password upon execution of the boot loader will prevent an unauthorized user from entering boot parameters or changing the boot partition. This prevents users from weakening security (e.g. turning off AppArmor at boot time).

Create an encrypted password with grub-mkpasswd-pbkdf2 :

# grub-mkpasswd-pbkdf2
Enter password: <password>
Reenter password: <password>
Your PBKDF2 is <encrypted-password>

Add the following into a custom /etc/grub.d configuration file:

cat <<EOF
set superusers="<username>"
password_pbkdf2 <username> <encrypted-password>
EOF

** The superuser/user information and password should not be contained in the /etc/grub.d/00_header file as this file could be overwritten in a package update.**

If there is a requirement to be able to boot/reboot without entering the password, edit /etc/grub.d/10_linux and add --unrestricted to the line CLASS=

Example:

CLASS="--class gnu-linux --class gnu --class os --unrestricted"

Run the following command to update the grub2 configuration:

# update-grub

Impact:

If password protection is enabled, only the designated superuser can edit a Grub 2 menu item by pressing "e" or access the GRUB 2 command line by pressing "c"

If GRUB 2 is set up to boot automatically to a password-protected menu entry the user has no option to back out of the password prompt to select another menu entry. Holding the SHIFT key will not display the menu in this case. The user must enter the correct username and password. If unable, the configuration files will have to be edited via the LiveCD or other means to fix the problem

You can add --unrestricted to the menu entries to allow the system to boot without entering a password. Password will still be required to edit menu items.

More Information: https://help.ubuntu.com/community/Grub2/Passwords

References:

Back to Summary

1.5.3 Ensure authentication required for single user mode

Description:

Single user mode is used for recovery when the system detects an issue during boot or by manual selection from the bootloader.

Requiring authentication in single user mode prevents an unauthorized user from rebooting the system into single user to gain root privileges without credentials.

Run the following command and follow the prompts to set a password for the root user:

# passwd root

References:

Back to Summary

1.5.4 Ensure interactive boot is not enabled

Description:

Interactive boot allows console users to interactively select which services start on boot. Not all distributions support this capability.

The PROMPT_FOR_CONFIRM option provides console users the ability to interactively boot the system and select which services to start on boot .

Turn off the PROMPT_FOR_CONFIRM option on the console to prevent console users from potentially overriding established security settings.

If interactive boot is available disable it.

References:

Back to Summary

1.6 Additional Process Hardening

1.6.1 Ensure XD/NX support is enabled

Description:

Recent processors in the x86 family support the ability to prevent code execution on a per memory page basis. Generically and on AMD processors, this ability is called No Execute (NX), while on Intel processors it is called Execute Disable (XD). This ability can help prevent exploitation of buffer overflow vulnerabilities and should be activated whenever possible. Extra steps must be taken to ensure that this protection is enabled, particularly on 32-bit x86 systems. Other processors, such as Itanium and POWER, have included such support since inception and the standard kernel for those platforms supports the feature.

Enabling any feature that can protect against buffer overflow attacks enhances the security of the system.

On 32 bit systems install a kernel with PAE support, no installation is required on 64 bit systems:

If necessary configure your bootloader to load the new kernel and reboot the system.

You may need to enable NX or XD support in your bios.

References:

Back to Summary

1.6.2 Ensure address space layout randomization (ASLR) is enabled

Description:

Address space layout randomization (ASLR) is an exploit mitigation technique which randomly arranges the address space of key data areas of a process.

Randomly placing virtual memory regions will make it difficult to write memory page exploits as the memory placement will be consistently shifting.

Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file:

kernel.randomize_va_space = 2

Run the following command to set the active kernel parameter:

# sysctl -w kernel.randomize_va_space=2

References:

Back to Summary

1.6.3 Ensure prelink is disabled

Description:

prelink is a program that modifies ELF shared libraries and ELF dynamically linked binaries in such a way that the time needed for the dynamic linker to perform relocations at startup significantly decreases.

The prelinking feature can interfere with the operation of AIDE, because it changes binaries. Prelinking can also increase the vulnerability of the system if a malicious user is able to compromise a common library such as libc.

Run the following command to restore binaries to normal:

# prelink -ua

Uninstall prelink using the appropriate package manager or manual installation:

# apt purge prelink

References:

Back to Summary

1.6.4 Ensure core dumps are restricted

Description:

A core dump is the memory of an executable program. It is generally used to determine why a program aborted. It can also be used to glean confidential information from a core file. The system provides the ability to set a soft limit for core dumps, but this can be overridden by the user.

Setting a hard limit on core dumps prevents users from overriding the soft variable. If core dumps are required, consider setting limits for user groups (see limits.conf(5) ). In addition, setting the fs.suid_dumpable variable to 0 will prevent setuid programs from dumping core.

Add the following line to /etc/security/limits.conf or a /etc/security/limits.d/* file:

* hard core 0

Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file:

fs.suid_dumpable = 0

Run the following command to set the active kernel parameter:

# sysctl -w fs.suid_dumpable=0

If systemd-coredump is installed:

edit /etc/systemd/coredump.conf and add/modify the following lines:

Storage=none
ProcessSizeMax=0

Run the command:

systemctl daemon-reload

References:

Back to Summary

1.7 Mandatory Access Control

Mandatory Access Control (MAC) provides an additional layer of access restrictions to processes on top of the base Discretionary Access Controls. By restricting how processes can access files and resources on a system the potential impact from vulnerabilities in the processes can be reduced.

Impact: Mandatory Access Control limits the capabilities of applications and daemons on a system, while this can prevent unauthorized access the configuration of MAC can be complex and difficult to implement correctly preventing legitimate access from occurring.

Note: Apparmor is the default MAC provided with Ubuntu systems.

Note: Additional Mandatory Access Control systems to include SELinux exist. If a different Mandatory Access Control systems is used, please follow it's vendors guidance for proper implementation in place of the guidance provided in this section

1.7.1 Configure AppArmor

AppArmor provides a Mandatory Access Control (MAC) system that greatly augments the default Discretionary Access Control (DAC) model. Under AppArmor MAC rules are applied by file paths instead of by security contexts as in other MAC systems. As such it does not require support in the filesystem and can be applied to network mounted filesystems for example. AppArmor security policies define what system resources applications can access and what privileges they can do so with. This automatically limits the damage that the software can do to files accessible by the calling user. The user does not need to take any action to gain this benefit. For an action to occur, both the traditional DAC permissions must be satisfied as well as the AppArmor MAC rules. The action will not be allowed if either one of these models does not permit the action. In this way, AppArmor rules can only make a system's permissions more restrictive and secure.

References:

  1. AppArmor Documentation: http://wiki.apparmor.net/index.php/Documentation
  2. Ubuntu AppArmor Documentation: https://help.ubuntu.com/community/AppArmor
  3. SUSE AppArmor Documentation: https://www.suse.com/documentation/apparmor/

1.7.1.1 Ensure AppArmor is installed

Description:

AppArmor provides Mandatory Access Controls.

Without a Mandatory Access Control system installed only the default Discretionary Access Control system will be available.

Install Apparmor.

# apt install apparmor apparmor-utils

References:

Back to Summary

1.7.1.2 Ensure AppArmor is enabled in the bootloader configuration

Description:

Configure AppArmor to be enabled at boot time and verify that it has not been overwritten by the bootloader boot parameters.

AppArmor must be enabled at boot time in your bootloader configuration to ensure that the controls it provides are not overridden.

edit /etc/default/grub and add the appermor=1 and security=apparmor parameters to the GRUB_CMDLINE_LINUX= line

GRUB_CMDLINE_LINUX="apparmor=1 security=apparmor"

Run the following command to update the grub2 configuration:

# update-grub

References:

Back to Summary

1.7.1.3 Ensure all AppArmor Profiles are in enforce or complain mode

Description:

AppArmor profiles define what resources applications are able to access.

Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.

Run the following command to set all profiles to enforce mode:

# aa-enforce /etc/apparmor.d/*

OR

Run the following command to set all profiles to complain mode:

# aa-complain /etc/apparmor.d/*

Any unconfined processes may need to have a profile created or activated for them and then be restarted.

References:

Back to Summary

1.7.1.4 Ensure all AppArmor Profiles are enforcing

Description:

AppArmor profiles define what resources applications are able to access.

Security configuration requirements vary from site to site. Some sites may mandate a policy that is stricter than the default policy, which is perfectly acceptable. This item is intended to ensure that any policies that exist on the system are activated.

Run the following command to set all profiles to enforce mode:

# aa-enforce /etc/apparmor.d/*

Any unconfined processes may need to have a profile created or activated for them and then be restarted.

References:

Back to Summary

1.8 Warning Banners

Presenting a warning message prior to the normal user login may assist in the prosecution of trespassers on the computer system. Changing some of these login banners also has the side effect of hiding OS version information and other detailed system information from attackers attempting to target specific exploits at a system.

Guidelines published by the US Department of Defense require that warning messages include at least the name of the organization that owns the system, the fact that the system is subject to monitoring and that such monitoring is in compliance with local statutes, and that use of the system implies consent to such monitoring. It is important that the organization's legal counsel review the content of all messages before any system modifications are made, as these warning messages are inherently site-specific. More information (including citations of relevant case law) can be found at http://www.justice.gov/criminal/cybercrime/

Note: The text provided in the remediation actions for these items is intended as an example only. Please edit to include the specific text for your organization as approved by your legal department.

1.8.1 Command Line Warning Banners

The /etc/motd , /etc/issue , and /etc/issue.net files govern warning banners for standard command line logins for both local and remote users.

1.8.1.1 Ensure message of the day is configured properly

Description:

The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users.

Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \m - machine architecture \r - operating system release \s - operating system name \v - operating system version

Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.

Edit the /etc/motd file with the appropriate contents according to your site policy, remove any instances of \m , \r , \s , \v or references to the OS platform

OR

If the motd is not used, this file can be removed.

Run the following command to remove the motd file:

# rm /etc/motd

References:

Back to Summary

1.8.1.2 Ensure local login warning banner is configured properly

Description:

The contents of the /etc/issue file are displayed to users prior to login for local terminals.

Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \m - machine architecture \r - operating system release \s - operating system name \v - operating system version - or the operating system's name

Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.

Edit the /etc/issue file with the appropriate contents according to your site policy, remove any instances of \m , \r , \s , \v or references to the OS platform

# echo "Authorized uses only. All activity may be monitored and reported." > /etc/issue

References:

Back to Summary

1.8.1.3 Ensure remote login warning banner is configured properly

Description:

The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services.

Unix-based systems have typically displayed information about the OS release and patch level upon logging in to the system. This information can be useful to developers who are developing software for a particular OS platform. If mingetty(8) supports the following options, they display operating system information: \m - machine architecture \r - operating system release \s - operating system name \v - operating system version

Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place. Displaying OS and patch level information in login banners also has the side effect of providing detailed system information to attackers attempting to target specific exploits of a system. Authorized users can easily get this information by running the " uname -a " command once they have logged in.

Edit the /etc/issue.net file with the appropriate contents according to your site policy, remove any instances of \m , \r , \s , \v or references to the OS platform

# echo "Authorized uses only. All activity may be monitored and reported." > /etc/issue.net

References:

Back to Summary

1.8.1.4 Ensure permissions on /etc/motd are configured

Description:

The contents of the /etc/motd file are displayed to users after login and function as a message of the day for authenticated users.

If the /etc/motd file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information.

Run the following commands to set permissions on /etc/motd :

# chown root:root /etc/motd # chmod u-x,go-wx /etc/motd

References:

Back to Summary

1.8.1.5 Ensure permissions on /etc/issue are configured

Description:

The contents of the /etc/issue file are displayed to users prior to login for local terminals.

If the /etc/issue file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information.

Run the following commands to set permissions on /etc/issue :

# chown root:root /etc/issue # chmod u-x,go-wx /etc/issue

References:

Back to Summary

1.8.1.6 Ensure permissions on /etc/issue.net are configured

Description:

The contents of the /etc/issue.net file are displayed to users prior to login for remote connections from configured services.

If the /etc/issue.net file does not have the correct ownership it could be modified by unauthorized users with incorrect or misleading information.

Run the following commands to set permissions on /etc/issue.net :

# chown root:root /etc/issue.net # chmod u-x,go-wx /etc/issue.net

References:

Back to Summary

1.8.2 Ensure GDM login banner is configured

Description:

GDM is the GNOME Display Manager which handles graphical login for GNOME based systems.

Warning messages inform users who are attempting to login to the system of their legal status regarding the system and must include the name of the organization that owns the system and any monitoring policies that are in place.

Edit or create the file /etc/gdm3/greeter.dconf-defaults and add the following:

[org/gnome/login-screen]
banner-message-enable=true
banner-message-text='Authorized uses only. All activity may be monitored and reported.'

References:

Back to Summary

1.9 Ensure updates, patches, and additional security software are installed

Description:

Periodically patches are released for included software either due to security flaws or to include additional functionality.

Newer patches may contain security enhancements that would not be available through the latest full update. As a result, it is recommended that the latest software patches be used to take advantage of the latest functionality. As with any software installation, organizations need to determine if a given update meets their requirements and verify the compatibility and supportability of any additional software against the update revision that is selected.

Use your package manager to update all packages on the system according to site policy.

Run the following command to update all packages following local site policy guidance on applying updates and patches:

# apt upgrade

OR

# apt dist-upgrade

References:

Back to Summary

2 Services

While applying system updates and patches helps correct known vulnerabilities, one of the best ways to protect the system against as yet unreported vulnerabilities is to disable all services that are not required for normal system operation. This prevents the exploitation of vulnerabilities discovered at a later date. If a service is not enabled, it cannot be exploited. The actions in this section of the document provide guidance on some services which can be safely disabled and under which circumstances, greatly reducing the number of possible threats to the resulting system. Additionally some services which should remain enabled but with secure configuration are covered as well as insecure service clients.

2.1 inetd Services

inetd is a super-server daemon that provides internet services and passes connections to configured services. While not commonly used inetd and any unneeded inetd based services should be disabled if possible.

Pass

2.1.1 Ensure xinetd is not installed

Description:

The eXtended InterNET Daemon ( xinetd ) is an open source super daemon that replaced the original inetd daemon. The xinetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests.

If there are no xinetd services required, it is recommended that the package be removed.

Run the following commands to remove xinetd :

# apt purge xinetd

Ensure package name equals 'xinetd' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: xinetd does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.1.1_Ensure_xinetd_is_not_installed"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:31.984+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:31.984+07:00"
         start-time="2022-01-05T01:03:31.946+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'xinetd' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806692"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806692"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2101">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="xinetd"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806692"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.1.2 Ensure openbsd-inetd is not installed

Description:

The inetd daemon listens for well known services and dispatches the appropriate daemon to properly respond to service requests.

If there are no inetd services required, it is recommended that the daemon be removed.

Run the following command to uninstall openbsd-inetd :

apt-get remove openbsd-inetd

Ensure package name equals 'openbsd-inetd' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openbsd-inetd does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.1.2_Ensure_openbsd-inetd_is_not_installed"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.047+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.047+07:00"
         start-time="2022-01-05T01:03:32.013+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openbsd-inetd' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806695"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806695"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2102">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openbsd-inetd"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806695"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

2.2 Special Purpose Services

This section describes services that are installed on systems that specifically need to run these services. If any of these services are not required, it is recommended that they be disabled or deleted from the system to reduce the potential attack surface.

2.2.1 Time Synchronization

It is recommended that physical systems and virtual guests lacking direct access to the physical host's clock be configured to synchronize their time using a service such as systemd-timesyncd, chrony, or ntp.

If access to a physical host's clock is available and configured according to site policy, this section can be skipped.

Pass

2.2.1.1 Ensure time synchronization is in use

Description:

System time should be synchronized between all systems in an environment. This is typically done by establishing an authoritative time server or set of servers and having all systems synchronize their clocks to them.

Time synchronization is important to support time sensitive security mechanisms like Kerberos and also ensures log files have consistent time records across the enterprise, which aids in forensic investigations.

On systems where host based time synchronization is not available, configure systemd-timesyncd. If "full featured" and/or encrypted time synchronization is required, install chrony or NTP.

To install chrony:

# atp install chrony

To install ntp:

# apt install ntp

On virtual systems where host based time synchronization is available consult your virtualization software documentation and setup host based synchronization.

Any of the following tests or sub-groups may pass:
Ensure standard service 'systemd-timesyncd' is enabled -- More
Check: All Must Pass
Unit: systemd-timesyncd
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to be set to enabled enabled
Any of the following tests or sub-groups may pass:
Ensure package name equals 'ntp' is installed -- Less
CIS-CAT expected to collect at least 1 matching dpkg Package, and found 0 items.
Package Name: ntp does not exist
Ensure package name equals 'chrony' is installed -- Less
CIS-CAT expected to collect at least 1 matching dpkg Package, and found 0 items.
Package Name: chrony does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.1.1_Ensure_time_synchronization_is_in_use"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.145+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.146+07:00"
         start-time="2022-01-05T01:03:32.076+07:00">
<cis:or>
 <cis:or>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure package name equals 'ntp' is installed"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806938"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806938"
                       type="dpkginfo_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2103">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="name" value="ntp"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure package name equals 'chrony' is installed"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806943"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806943"
                       type="dpkginfo_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2104">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="name" value="chrony"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure standard service 'systemd-timesyncd' is enabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806950"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806950"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806950">
       <cis:evidence_item itemref="2105">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="systemd-timesyncd"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="enabled" dt="string" ev="enabled" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806938"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806943"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806950"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.2.1.3 Ensure chrony is configured

Description:

chrony is a daemon which implements the Network Time Protocol (NTP) is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on chrony can be found at http://chrony.tuxfamily.org/ . chrony can be configured to be a client and/or a server.

If chrony is in use on the system proper configuration is vital to ensuring time synchronization is working properly.

This recommendation only applies if chrony is in use on the system.

Add or edit server or pool lines to /etc/chrony.conf as appropriate:

server <remote-server>

Configure chrony to run as the chrony user by configuring the appropriate startup script for your distribution. Startup scripts are typically stored in /etc/init.d or /etc/systemd .

Any of the following tests or sub-groups may pass:
Ensure package name equals 'chrony' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: chrony does not exist
All of the following tests or sub-groups must pass:
Linux Custom Object "chronyd is running as chrony user" -- More
CIS-CAT did not expect to collect any matching Process items, and found 0 items.
Command-Line: ^chronyd, PID: 0 does not exist
Ensure at least one file named /etc/chrony.conf exists and matches pattern ^\s*(server|pool)\s+\S+ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/chrony.conf does not exist
Pattern: ^\s*(server|pool)\s+\S+
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.1.3_Ensure_chrony_is_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.264+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.265+07:00"
         start-time="2022-01-05T01:03:32.150+07:00">
<cis:or>
 <cis:and>
    <cis:evidence_test check="all" check_existence="none_exist"
                       comment="Linux Custom Object &#34;chronyd is running as chrony user&#34;"
                       negated="false"
                       ns="unix"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807004"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807004"
                       type="process58_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2107">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="command_line" value="^chronyd"/>
                <cis:evidence_item_pk_field name="pid" value="0"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure at least one file named /etc/chrony.conf exists and matches pattern ^\s*(server|pool)\s+\S+"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806999"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806999"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2108">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/chrony.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*(server|pool)\s+\S+"/>
                <cis:evidence_item_pk_field name="instance" value="1"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'chrony' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807008"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807008"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2109">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="chrony"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806999"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807004"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807008"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.2.1.4 Ensure ntp is configured

Description:

ntp is a daemon which implements the Network Time Protocol (NTP). It is designed to synchronize system clocks across a variety of systems and use a source that is highly accurate. More information on NTP can be found at http://www.ntp.org . ntp can be configured to be a client and/or a server.

This recommendation only applies if ntp is in use on the system.

If ntp is in use on the system proper configuration is vital to ensuring time synchronization is working properly.

Add or edit restrict lines in /etc/ntp.conf to match the following:

restrict -4 default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery

Add or edit server or pool lines to /etc/ntp.conf as appropriate:

server <remote-server>

Configure ntp to run as the ntp user by adding or editing one of the following files as appropriate for your distribution: /etc/sysconfig/ntpd :

OPTIONS="-u ntp:ntp"

/etc/sysconfig/ntp :

NTPD_OPTIONS="-u ntp:ntp"

/etc/init.d/ntp :

RUNASUSER=ntp

Any of the following tests or sub-groups may pass:
Ensure package name equals 'ntp' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: ntp does not exist
All of the following tests or sub-groups must pass:
All of the following tests or sub-groups must pass:
Ensure at least one file named /etc/sysconfig/ntpd exists and matches pattern ^\s*NTPD_OPTIONS="[^"]*-u ntp:ntp[^"]*"\s*(?:#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysconfig/ntpd does not exist
Pattern: ^\s*NTPD_OPTIONS="[^"]*-u ntp:ntp[^"]*"\s*(?:#.*)?$
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensure at least one file named /etc/ntp.conf exists and matches pattern ^\s*restrict\s+-6\s+default(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/ntp.conf does not exist
Pattern: ^\s*restrict\s+-6\s+default(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(?:#.*)?$
Match Text: No match found
Ensure at least one file named /etc/ntp.conf exists and matches pattern ^\s*restrict\s+(-4\s+)?default(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s* -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/ntp.conf does not exist
Pattern: ^\s*restrict\s+(-4\s+)?default(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(?:#.*)?$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure at least one file named /etc/init.d/ntp exists and matches pattern ^\s*RUNASUSER\s*=\s*ntp\s*(?:#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/init.d/ntp does not exist
Pattern: ^\s*RUNASUSER\s*=\s*ntp\s*(?:#.*)?$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure at least one file named /etc/ntp.conf exists and matches pattern ^\s*(server|pool)\s+\S+ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/ntp.conf does not exist
Pattern: ^\s*(server|pool)\s+\S+
Match Text: No match found
Ensure at least one file named /etc/sysconfig/ntpd exists and matches pattern ^\s*OPTIONS="[^"]*-u ntp:ntp[^"]*"\s*(?:#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysconfig/ntpd does not exist
Pattern: ^\s*OPTIONS="[^"]*-u ntp:ntp[^"]*"\s*(?:#.*)?$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.1.4_Ensure_ntp_is_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.377+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.378+07:00"
         start-time="2022-01-05T01:03:32.305+07:00">
<cis:or>
 <cis:and>
    <cis:and>
       <cis:and>
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure at least one file named /etc/ntp.conf exists and matches pattern ^\s*restrict\s+-6\s+default(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806961"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806961"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2110">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/ntp.conf"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*restrict\s+-6\s+default(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(?:#.*)?$"/>
                      <cis:evidence_item_pk_field name="instance" value="1"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure at least one file named /etc/ntp.conf exists and matches pattern ^\s*restrict\s+(-4\s+)?default(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806957"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806957"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2111">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/ntp.conf"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*restrict\s+(-4\s+)?default(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(\s*\bkod\b\s*|\s*\bnomodify\b\s*|\s*\bnotrap\b\s*|\s*\bnopeer\b\s*|\s*\bnoquery\b\s*)(?:#.*)?$"/>
                      <cis:evidence_item_pk_field name="instance" value="1"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
       </cis:and>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure at least one file named /etc/sysconfig/ntpd exists and matches pattern ^\s*NTPD_OPTIONS=&#34;[^&#34;]*-u ntp:ntp[^&#34;]*&#34;\s*(?:#.*)?$"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806990"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806990"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2112">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysconfig/ntpd"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*NTPD_OPTIONS=&#34;[^&#34;]*-u ntp:ntp[^&#34;]*&#34;\s*(?:#.*)?$"/>
                   <cis:evidence_item_pk_field name="instance" value="1"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:and>
    <cis:or>
       <cis:or>
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure at least one file named /etc/ntp.conf exists and matches pattern ^\s*(server|pool)\s+\S+"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806966"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806966"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2113">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/ntp.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*(server|pool)\s+\S+"/>
                      <cis:evidence_item_pk_field name="instance" value="1"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure at least one file named /etc/sysconfig/ntpd exists and matches pattern ^\s*OPTIONS=&#34;[^&#34;]*-u ntp:ntp[^&#34;]*&#34;\s*(?:#.*)?$"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806973"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806973"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2114">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysconfig/ntpd"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*OPTIONS=&#34;[^&#34;]*-u ntp:ntp[^&#34;]*&#34;\s*(?:#.*)?$"/>
                      <cis:evidence_item_pk_field name="instance" value="1"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
       </cis:or>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure at least one file named /etc/init.d/ntp exists and matches pattern ^\s*RUNASUSER\s*=\s*ntp\s*(?:#.*)?$"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806978"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806978"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2115">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/init.d/ntp"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*RUNASUSER\s*=\s*ntp\s*(?:#.*)?$"/>
                   <cis:evidence_item_pk_field name="instance" value="1"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:or>
 </cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'ntp' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806984"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806984"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2116">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="ntp"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806984"/>
</check>
<xccdf:complex-check operator="AND">
<xccdf:complex-check operator="AND">
 <xccdf:complex-check operator="AND">
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806957"/>
    </check>
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806961"/>
    </check>
 </xccdf:complex-check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806990"/>
 </check>
</xccdf:complex-check>
<xccdf:complex-check operator="OR">
 <xccdf:complex-check operator="OR">
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806966"/>
    </check>
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806973"/>
    </check>
 </xccdf:complex-check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806978"/>
 </check>
</xccdf:complex-check>
</xccdf:complex-check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

2.2.2 Ensure X Window System is not installed

Description:

The X Window System provides a Graphical User Interface (GUI) where users can have multiple windows in which to run programs and various add on. The X Windows system is typically used on workstations where users login, but not on servers where users typically do not login.

Unless your organization specifically requires graphical login access via X Windows, remove it to reduce the potential attack surface.

Remove the X Windows System packages:

apt purge xserver-xorg*

Impact:

Many Linux systems run applications which require a Java runtime. Some Linux Java packages have a dependency on specific X Windows xorg-x11-fonts. One workaround to avoid this dependency is to use the "headless" Java packages for your specific Java runtime, if provided by your distribution.

All of the following tests or sub-groups must pass:
Ensure package name pattern match '^xorg-x11.*' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: ^xorg-x11.* does not exist
Ensure package name pattern match '^xserver-xorg.*' is not installed -- Less
CIS-CAT did not expect to collect any matching dpkg Packages, and found 16 items.
Package Name: xserver-xorg exists
Package Name: xserver-xorg-core exists
Package Name: xserver-xorg-input-all exists
Package Name: xserver-xorg-input-libinput exists
Package Name: xserver-xorg-input-wacom exists
Package Name: xserver-xorg-legacy exists
Package Name: xserver-xorg-video-all exists
Package Name: xserver-xorg-video-amdgpu exists
Package Name: xserver-xorg-video-ati exists
Package Name: xserver-xorg-video-fbdev exists
Package Name: xserver-xorg-video-intel exists
Package Name: xserver-xorg-video-nouveau exists
Package Name: xserver-xorg-video-qxl exists
Package Name: xserver-xorg-video-radeon exists
Package Name: xserver-xorg-video-vesa exists
Package Name: xserver-xorg-video-vmware exists

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.2_Ensure_X_Window_System_is_not_installed"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:33.305+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/2/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:33.305+07:00"
         start-time="2022-01-05T01:03:32.797+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name pattern match '^xorg-x11.*' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806702"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806702"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2124">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="^xorg-x11.*"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name pattern match '^xserver-xorg.*' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806709"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806709"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2125">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2126">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-core"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2127">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-input-all"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2128">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-input-libinput"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2129">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-input-wacom"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2130">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-legacy"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2131">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-video-all"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2132">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-video-amdgpu"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2133">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-video-ati"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2134">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-video-fbdev"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2135">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-video-intel"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2136">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-video-nouveau"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2137">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-video-qxl"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2138">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-video-radeon"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2139">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-video-vesa"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2140">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="xserver-xorg-video-vmware"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806702"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806709"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

2.2.3 Ensure Avahi Server is not enabled

Description:

Avahi is a free zeroconf implementation, including a system for multicast DNS/DNS-SD service discovery. Avahi allows programs to publish and discover services and hosts running on a local network with no specific configuration. For example, a user can plug a computer into a network and Avahi automatically finds printers to print to, files to look at and people to talk to, as well as network services running on the machine.

Automatic discovery of network services is not normally required for system functionality. It is recommended to disable the service to reduce the potential attack surface.

Run the following command to disable avahi-daemon :

# systemctl --now disable avahi-daemon

Ensure standard service 'avahi-daemon' is disabled -- Less
Check: All Must Pass
Unit: avahi-daemon
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.3_Ensure_Avahi_Server_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:33.386+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:33.386+07:00"
         start-time="2022-01-05T01:03:33.362+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'avahi-daemon' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806720"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806720"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806720">
       <cis:evidence_item itemref="2141">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="avahi-daemon"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="enabled" dt="string" ev="enabled" name="value" op="not equal"
                              result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806720"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

2.2.4 Ensure CUPS is not enabled

Description:

The Common Unix Print System (CUPS) provides the ability to print to both local and network printers. A system running CUPS can also accept print jobs from remote systems and print them to local printers. It also provides a web based remote administration capability.

If the system does not need to print jobs or accept print jobs from other systems, it is recommended that CUPS be disabled to reduce the potential attack surface.

Run one of the following commands to disable cups :

# systemctl --now disable cups

Impact:

Disabling CUPS will prevent printing from the system, a common task for workstation systems.

Ensure standard service 'cups' is disabled -- Less
Check: All Must Pass
Unit: cups
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.4_Ensure_CUPS_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:33.462+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">More detailed documentation on CUPS is available at the project homepage at http://www.cups.org.</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:33.463+07:00"
         start-time="2022-01-05T01:03:33.431+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'cups' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806729"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806729"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806729">
       <cis:evidence_item itemref="2142">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="cups"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="enabled" dt="string" ev="enabled" name="value" op="not equal"
                              result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806729"/>
</check>
</complex-check>
</rule-result>

References:

Pass

2.2.5 Ensure DHCP Server is not enabled

Description:

The Dynamic Host Configuration Protocol (DHCP) is a service that allows machines to be dynamically assigned IP addresses.

Unless a system is specifically set up to act as a DHCP server, it is recommended that this service be deleted to reduce the potential attack surface.

Run one of the following commands to disable dhcpd :

# systemctl --now disable isc-dhcp-server # systemctl --now disable isc-dhcp-server6

All of the following tests or sub-groups must pass:
Ensure standard service 'isc-dhcp-server6' is disabled -- More
Check: All Must Pass
Unit: isc-dhcp-server6
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled
Ensure standard service 'isc-dhcp-server' is disabled -- More
Check: All Must Pass
Unit: isc-dhcp-server
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.5_Ensure_DHCP_Server_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:33.547+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">More detailed documentation on DHCP is available at http://www.isc.org/software/dhcp.</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:33.548+07:00"
         start-time="2022-01-05T01:03:33.508+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'isc-dhcp-server6' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806744"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806744"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806744">
       <cis:evidence_item itemref="2143">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="isc-dhcp-server6"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'isc-dhcp-server' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806738"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806738"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806738">
       <cis:evidence_item itemref="2144">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="isc-dhcp-server"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806738"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806744"/>
</check>
</complex-check>
</rule-result>

References:

Unknown

2.2.6 Ensure LDAP server is not enabled

Description:

The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database.

If the system will not need to act as an LDAP server, it is recommended that the software be disabled to reduce the potential attack surface.

Run one of the following commands to disable slapd :

# systemctl --now disable slapd

Ensure LDAP server is not enabled -- More
Script: sce/service_chk.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.6_Ensure_LDAP_server_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:33.557+07:00"
  version="1"
  weight="1.0">
<result>unknown</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">For more detailed documentation on OpenLDAP, go to the project homepage at http://www.openldap.org.</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:33.558+07:00"
         start-time="2022-01-05T01:03:33.557+07:00">
<cis:and>
 <cis:evidence_test comment="Ensure LDAP server is not enabled" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/service_chk.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806751_var"/>
<check-content-ref href="sce/service_chk.sh"/>
</check>
</complex-check>
</rule-result>

References:

Pass

2.2.7 Ensure NFS and RPC are not enabled

Description:

The Network File System (NFS) is one of the first and most widely distributed file systems in the UNIX environment. It provides the ability for systems to mount file systems of other servers through the network.

If the system does not export NFS shares or act as an NFS client, it is recommended that these services be disabled to reduce the remote attack surface.

Run the following commands to disable nfs and rpcbind :

# systemctl --now disable nfs-server

# systemctl --now disable rpcbind

All of the following tests or sub-groups must pass:
Ensure standard service 'nfs-server' is disabled -- More
Check: All Must Pass
Unit: nfs-server
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled
Ensure standard service 'rpcbind' is disabled -- More
Check: All Must Pass
Unit: rpcbind
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.7_Ensure_NFS_and_RPC_are_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:33.619+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:33.620+07:00"
         start-time="2022-01-05T01:03:33.563+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'nfs-server' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806759"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806759"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806759">
       <cis:evidence_item itemref="2145">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="nfs-server"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'rpcbind' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806763"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806763"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806763">
       <cis:evidence_item itemref="2146">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="rpcbind"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806759"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806763"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.2.8 Ensure DNS Server is not enabled

Description:

The Domain Name System (DNS) is a hierarchical naming system that maps names to IP addresses for computers, services and other resources connected to a network.

Unless a system is specifically designated to act as a DNS server, it is recommended that the package be deleted to reduce the potential attack surface.

Run the following commands to disable DNS server :

# systemctl --now disable bind9

Ensure standard service 'bind9' is disabled -- More
Check: All Must Pass
Unit: bind9
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.8_Ensure_DNS_Server_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:33.720+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:33.722+07:00"
         start-time="2022-01-05T01:03:33.688+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'bind9' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806771"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806771"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806771">
       <cis:evidence_item itemref="2147">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="bind9"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806771"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.2.9 Ensure FTP Server is not enabled

Description:

The File Transfer Protocol (FTP) provides networked computers with the ability to transfer files.

FTP does not protect the confidentiality of data or authentication credentials. It is recommended SFTP be used if file transfer is required. Unless there is a need to run the system as a FTP server (for example, to allow anonymous downloads), it is recommended that the package be deleted to reduce the potential attack surface.

Run the following command to disable vsftpd :

# systemctl --now disable vsftpd

Ensure standard service 'vsftpd' is disabled -- More
Check: All Must Pass
Unit: vsftpd
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.9_Ensure_FTP_Server_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:33.797+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:33.806+07:00"
         start-time="2022-01-05T01:03:33.782+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'vsftpd' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806777"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806777"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806777">
       <cis:evidence_item itemref="2148">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="vsftpd"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806777"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.2.10 Ensure HTTP server is not enabled

Description:

HTTP or web servers provide the ability to host web site content.

Unless there is a need to run the system as a web server, it is recommended that the package be deleted to reduce the potential attack surface.

Run the following command to disable apache :

# systemctl --now disable apache2

Ensure standard service 'apache2' is disabled -- More
Check: All Must Pass
Unit: apache2
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.10_Ensure_HTTP_server_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.394+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.395+07:00"
         start-time="2022-01-05T01:03:32.382+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'apache2' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806786"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806786"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806786">
       <cis:evidence_item itemref="2117">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="apache2"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806786"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.2.11 Ensure email services are not enabled

Description:

dovecot is an open source mail submission and transport server for Linux based systems.

Unless mail transport services are to be provided by this system, it is recommended that the service be disabled or deleted to reduce the potential attack surface.

Run one of the following commands to disable dovecot :

# systemctl --now disable dovecot

Ensure standard service 'dovecot' is disabled -- More
Check: All Must Pass
Unit: dovecot
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.11_Ensure_email_services_are_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.456+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.456+07:00"
         start-time="2022-01-05T01:03:32.419+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'dovecot' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806796"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806796"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806796">
       <cis:evidence_item itemref="2118">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="dovecot"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806796"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.2.12 Ensure Samba is not enabled

Description:

The Samba daemon allows system administrators to configure their Linux systems to share file systems and directories with Windows desktops. Samba will advertise the file systems and directories via the Server Message Block (SMB) protocol. Windows desktop users will be able to mount these directories and file systems as letter drives on their systems.

If there is no need to mount directories and file systems to Windows systems, then this service can be deleted to reduce the potential attack surface.

Run the following command to disable Samba :

# systemctl --now disable smbd

Ensure standard service 'smbd' is disabled -- More
Check: All Must Pass
Unit: smbd
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.12_Ensure_Samba_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.518+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.519+07:00"
         start-time="2022-01-05T01:03:32.495+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'smbd' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806806"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806806"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806806">
       <cis:evidence_item itemref="2119">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="smbd"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806806"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Unknown

2.2.13 Ensure HTTP Proxy Server is not enabled

Description:

Squid is a standard proxy server used in many distributions and environments.

If there is no need for a proxy server, it is recommended that the squid proxy be deleted to reduce the potential attack surface.

Run the following command to disable squid :

# systemctl --now disable squid

Ensure HTTP Proxy Server is not enabled -- More
Script: sce/service_chk.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.13_Ensure_HTTP_Proxy_Server_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.567+07:00"
  version="1"
  weight="1.0">
<result>unknown</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.568+07:00"
         start-time="2022-01-05T01:03:32.567+07:00">
<cis:and>
 <cis:evidence_test comment="Ensure HTTP Proxy Server is not enabled" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/service_chk.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806815_var"/>
<check-content-ref href="sce/service_chk.sh"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.2.14 Ensure SNMP Server is not enabled

Description:

The Simple Network Management Protocol (SNMP) server is used to listen for SNMP commands from an SNMP management system, execute the commands or collect the information and then send results back to the requesting system.

The SNMP server can communicate using SNMP v1, which transmits data in the clear and does not require authentication to execute commands. Unless absolutely necessary, it is recommended that the SNMP service not be used. If SNMP is required the server should be configured to disallow SNMP v1.

Run the following command to disable snmpd :

# systemctl --now disable snmpd

Ensure standard service 'snmpd' is disabled -- More
Check: All Must Pass
Unit: snmpd
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.14_Ensure_SNMP_Server_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.630+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.631+07:00"
         start-time="2022-01-05T01:03:32.607+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'snmpd' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806825"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806825"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806825">
       <cis:evidence_item itemref="2120">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="snmpd"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806825"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.2.15 Ensure mail transfer agent is configured for local-only mode

Description:

Mail Transfer Agents (MTA), such as sendmail and Postfix, are used to listen for incoming mail and transfer the messages to the appropriate user or mail server. If the system is not intended to be a mail server, it is recommended that the MTA be configured to only process local mail.

The software for all Mail Transfer Agents is complex and most have a long history of security issues. While it is important to ensure that the system can process local mail messages, it is not necessary to have the MTA's daemon listening on a port unless the server is intended to be a mail server that receives and processes mail from other systems.

Edit /etc/postfix/main.cf and add the following line to the RECEIVING MAIL section. If the line already exists, change it to look like the line below:

inet_interfaces = loopback-only

Restart postfix:

# systemctl restart postfix

Linux Custom Object "No Servers Listening On Port 25" -- More
CIS-CAT did not expect to collect any matching items, and found 0 items.
Protocol: .*, Local Address: ^(?!127\.0\.0\.1|::1).*$, Local Port: 25 does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.15_Ensure_mail_transfer_agent_is_configured_for_local-only_mode"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.741+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.741+07:00"
         start-time="2022-01-05T01:03:32.666+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Linux Custom Object &#34;No Servers Listening On Port 25&#34;"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806842"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806842"
                    type="inetlisteningservers_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2122">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="protocol" value=".*"/>
             <cis:evidence_item_pk_field name="local_address" value="^(?!127\.0\.0\.1|::1).*$"/>
             <cis:evidence_item_pk_field name="local_port" value="25"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806842"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

2.2.16 Ensure rsync service is not enabled

Description:

The rsyncd service can be used to synchronize files between systems over network links.

The rsyncd service presents a security risk as it uses unencrypted protocols for communication.

Run the following command to disable rsyncd :

# systemctl --now disable rsync

Ensure standard service 'rsyncd' is disabled -- Less
Check: All Must Pass
Unit: rsync
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.16_Ensure_rsync_service_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.788+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.789+07:00"
         start-time="2022-01-05T01:03:32.766+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'rsyncd' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806861"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806861"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806861">
       <cis:evidence_item itemref="2123">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="rsync"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="enabled" dt="string" ev="enabled" name="value" op="not equal"
                              result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806861"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Unknown

2.2.17 Ensure NIS Server is not enabled

Description:

The Network Information Service (NIS) (formally known as Yellow Pages) is a client-server directory service protocol for distributing system configuration files. The NIS server is a collection of programs that allow for the distribution of configuration files.

The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be disabled and other, more secure services be used

Run the following command to disable nis :

# systemctl --now disable nis

Ensure NIS Server is not enabled -- More
Script: sce/service_chk.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.2.17_Ensure_NIS_Server_is_not_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:32.795+07:00"
  version="1"
  weight="1.0">
<result>unknown</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:32.796+07:00"
         start-time="2022-01-05T01:03:32.795+07:00">
<cis:and>
 <cis:evidence_test comment="Ensure NIS Server is not enabled" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/service_chk.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806878_var"/>
<check-content-ref href="sce/service_chk.sh"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

2.3 Service Clients

A number of insecure services exist. While disabling the servers prevents a local attack against these services, it is advised to remove their clients unless they are required.

Note : This should not be considered a comprehensive list of insecure service clients. You may wish to consider additions to those listed here for your environment.

Pass

2.3.1 Ensure NIS Client is not installed

Description:

The Network Information Service (NIS), formerly known as Yellow Pages, is a client-server directory service protocol used to distribute system configuration files. The NIS client was used to bind a machine to an NIS server and receive the distributed configuration files.

The NIS service is inherently an insecure system that has been vulnerable to DOS attacks, buffer overflows and has poor authentication for querying NIS maps. NIS generally has been replaced by such protocols as Lightweight Directory Access Protocol (LDAP). It is recommended that the service be removed.

Uninstall nis :

apt purge nis

Impact:

Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse.

Ensure package name equals 'nis' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: nis does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.3.1_Ensure_NIS_Client_is_not_installed"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:33.954+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/2/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:33.954+07:00"
         start-time="2022-01-05T01:03:33.871+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'nis' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806701"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806701"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2149">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="nis"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806701"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.3.2 Ensure rsh client is not installed

Description:

The rsh package contains the client commands for the rsh services.

These legacy clients contain numerous security exposures and have been replaced with the more secure SSH package. Even if the server is removed, it is best to ensure the clients are also removed to prevent users from inadvertently attempting to use these commands and therefore exposing their credentials. Note that removing the rsh package removes the clients for rsh , rcp and rlogin .

Uninstall rsh :

apt remove rsh-client

Impact:

Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse.

Ensure package name equals 'rsh-client' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: rsh-client does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.3.2_Ensure_rsh_client_is_not_installed"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:34.051+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/5"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:34.052+07:00"
         start-time="2022-01-05T01:03:33.984+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'rsh-client' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806707"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806707"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2150">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="rsh-client"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806707"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.3.3 Ensure talk client is not installed

Description:

The talk software makes it possible for users to send and receive messages across systems through a terminal session. The talk client, which allows initialization of talk sessions, is installed by default.

The software presents a security risk as it uses unencrypted protocols for communication.

Uninstall talk :

apt remove talk

Impact:

Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse.

Ensure package name equals 'talk' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: talk does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.3.3_Ensure_talk_client_is_not_installed"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:34.155+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/2/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:34.155+07:00"
         start-time="2022-01-05T01:03:34.087+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'talk' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806712"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806712"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2151">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="talk"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806712"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

2.3.4 Ensure telnet client is not installed

Description:

The telnet package contains the telnet client, which allows users to start connections to other systems via the telnet protocol.

The telnet protocol is insecure and unencrypted. The use of an unencrypted transmission medium could allow an unauthorized user to steal credentials. The ssh package provides an encrypted session and stronger security and is included in most Linux distributions.

Uninstall telnet :

# apt purge telnet

Impact:

Many insecure service clients are used as troubleshooting tools and in testing environments. Uninstalling them can inhibit capability to test and troubleshoot. If they are required it is advisable to remove the clients after use to prevent accidental or intentional misuse.

Ensure package name equals 'telnet' is not installed -- Less
CIS-CAT did not expect to collect any matching dpkg Packages, and found 1 item.
Package Name: telnet exists

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.3.4_Ensure_telnet_client_is_not_installed"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:34.266+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/5"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:34.266+07:00"
         start-time="2022-01-05T01:03:34.160+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'telnet' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806717"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806717"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2152">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="telnet"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806717"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

2.3.5 Ensure LDAP client is not installed

Description:

The Lightweight Directory Access Protocol (LDAP) was introduced as a replacement for NIS/YP. It is a service that provides a method for looking up information from a central database.

If the system will not need to act as an LDAP client, it is recommended that the software be removed to reduce the potential attack surface.

Uninstall ldap-utils :

# apt purge ldap-utils

Impact:

Removing the LDAP client will prevent or inhibit using LDAP for authentication in your environment.

Ensure package name equals 'ldap-utils' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: ldap-utils does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_2.3.5_Ensure_LDAP_client_is_not_installed"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:34.350+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/2/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:34.350+07:00"
         start-time="2022-01-05T01:03:34.289+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'ldap-utils' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806722"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806722"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2153">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="ldap-utils"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806722"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

3 Network Configuration

This section provides guidance on for securing the network configuration of the system through kernel parameters, access list control, and firewall settings.

3.1 Network Parameters (Host Only)

The following network parameters are intended for use if the system is to act as a host only. A system is considered host only if the system has a single interface, or has multiple interfaces but will not be configured as a router.

Fail

3.1.1 Ensure packet redirect sending is disabled

Description:

ICMP Redirects are used to send routing information to other hosts. As a host itself does not act as a router (in a host only configuration), there is no need to send redirects.

An attacker could use a compromised host to send invalid ICMP redirects to other router devices in an attempt to corrupt routing and have users access a system set up by the attacker as opposed to a valid system.

Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:

net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0

Run the following commands to set the active kernel parameters:

# sysctl -w net.ipv4.conf.all.send_redirects=0
# sysctl -w net.ipv4.conf.default.send_redirects=0
# sysctl -w net.ipv4.route.flush=1

All of the following tests or sub-groups must pass:
Ensure 'net.ipv4.conf.all.send_redirects' kernel parameter Equals 0 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.all.send_redirects
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.all.send_redirects net.ipv4.conf.all.send_redirects
the Kernel Parameter Value to be set to 0 1
Ensure 'net.ipv4.conf.default.send_redirects' kernel parameter Equals 0 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.default.send_redirects
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.default.send_redirects net.ipv4.conf.default.send_redirects
the Kernel Parameter Value to be set to 0 1
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.all.send_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv4.conf.all.send_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.default.send_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv4.conf.default.send_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.1.1_Ensure_packet_redirect_sending_is_disabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:34.396+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:34.397+07:00"
         start-time="2022-01-05T01:03:34.356+07:00">
<cis:and>
 <cis:or result="false">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.all.send_redirects' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068822"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068822"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2154">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.all.send_redirects' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068823"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068823"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2165">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2166">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2167">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2168">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2169">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2170">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2171">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2172">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2173">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2174">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:or result="false">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.default.send_redirects' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068852"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068852"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2175">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.default.send_redirects' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068853"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068853"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2186">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2187">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2188">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2189">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2190">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2191">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2192">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2193">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2194">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2195">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.send_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv4.conf.all.send_redirects' kernel parameter Equals 0 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068821"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068821"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8068821">
       <cis:evidence_item itemref="1463">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.all.send_redirects"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv4.conf.all.send_redirects" dt="string"
                              ev="net.ipv4.conf.all.send_redirects"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="1" dt="int" ev="0" name="value" op="equals" result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv4.conf.default.send_redirects' kernel parameter Equals 0 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068851"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068851"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8068851">
       <cis:evidence_item itemref="1494">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.default.send_redirects"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv4.conf.default.send_redirects" dt="string"
                              ev="net.ipv4.conf.default.send_redirects"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="1" dt="int" ev="0" name="value" op="equals" result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806882"
            value-id="xccdf_org.cisecurity.benchmarks_value_806882_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806882"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806885"
            value-id="xccdf_org.cisecurity.benchmarks_value_806885_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806885"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Unknown

3.1.2 Ensure IP forwarding is disabled

Description:

The net.ipv4.ip_forward and net.ipv6.conf.all.forwarding flags are used to tell the system whether it can forward packets or not.

Setting the flags to 0 ensures that a system with multiple interfaces (for example, a hard proxy), will never be able to forward packets, and therefore, never serve as a router.

Run the following commands to restore the default parameters and set the active kernel parameters:

# grep -Els "^\s*net\.ipv4\.ip_forward\s*=\s*1" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri "s/^\s*(net\.ipv4\.ip_forward\s*)(=)(\s*\S+\b).*$/# *REMOVED* \1/" $filename; done; sysctl -w net.ipv4.ip_forward=0; sysctl -w net.ipv4.route.flush=1 # grep -Els "^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1" /etc/sysctl.conf /etc/sysctl.d/*.conf /usr/lib/sysctl.d/*.conf /run/sysctl.d/*.conf | while read filename; do sed -ri "s/^\s*(net\.ipv6\.conf\.all\.forwarding\s*)(=)(\s*\S+\b).*$/# *REMOVED* \1/" $filename; done; sysctl -w net.ipv6.conf.all.forwarding=0; sysctl -w net.ipv6.route.flush=1

All of the following tests or sub-groups must pass:
Ensurefile(s) named ^\S+\.conf$ in /run/sysctl.d/ exists and matches pattern ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s* -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /run/sysctl.d//^\S+\.conf$ does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensurefile(s) named ^\S+\.conf$ in /usr/lib/sysctl.d/ exists and matches pattern ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s* -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /usr/lib/sysctl.d/50-default.conf does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensurefile(s) named ^\S+\.conf$ in /etc/sysctl.d/ exists and matches pattern ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s* -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensure no file named /etc/sysctl.conf exists and matches pattern ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s* -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensure IP forwarding is disabled -- More
Script: sce/sysctl_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
All of the following tests or sub-groups must pass:
Ensurefile(s) named ^\S+\.conf$ in /run/sysctl.d/ exists and matches pattern ^\s*net\.ipv4\.ip_forward\s*=\s*1\s* -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /run/sysctl.d//^\S+\.conf$ does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensurefile(s) named ^\S+\.conf$ in /usr/lib/sysctl.d/ exists and matches pattern ^\s*net\.ipv4\.ip_forward\s*=\s*1\s* -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /usr/lib/sysctl.d/50-default.conf does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensurefile(s) named ^\S+\.conf$ in /etc/sysctl.d/ exists and matches pattern ^\s*net\.ipv4\.ip_forward\s*=\s*1\s* -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensure no file named /etc/sysctl.conf exists and matches pattern ^\s*net\.ipv4\.ip_forward\s*=\s*1\s* -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*
Match Text: No match found
Ensure IP forwarding is disabled -- More
Script: sce/sysctl_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.1.2_Ensure_IP_forwarding_is_disabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:34.476+07:00"
  version="1"
  weight="1.0">
<result>unknown</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:34.476+07:00"
         start-time="2022-01-05T01:03:34.437+07:00">
<cis:and>
 <cis:and>
    <cis:and>
       <cis:and>
          <cis:and>
             <cis:and>
                <cis:and>
                   <cis:and>
                      <cis:and>
                         <cis:evidence_test check="all" check_existence="none_exist"
                                            comment="Ensure no file named /etc/sysctl.conf exists and matches pattern ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"
                                            negated="false"
                                            ns="independent"
                                            objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806834"
                                            result="true"
                                            testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806834"
                                            type="textfilecontent54_test">
                            <cis:evidence_object>
                               <cis:evidence_item itemref="2196">
                                  <cis:evidence_item_pk status="does not exist">
                                     <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                                     <cis:evidence_item_pk_field name="path" value="/etc"/>
                                     <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                                     <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                                  </cis:evidence_item_pk>
                               </cis:evidence_item>
                            </cis:evidence_object>
                         </cis:evidence_test>
                         <cis:evidence_test comment="Ensure IP forwarding is disabled" result="unknown">
                            <cis:evidence_sce exit-code="-1" full-path="" href="sce/sysctl_running_config.sh">
                               <cis:environment_variables>
                                  <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                                  <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                                  <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                                  <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                                  <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                                  <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                                  <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                                  <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                                  <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                               </cis:environment_variables>
                            </cis:evidence_sce>
                         </cis:evidence_test>
                      </cis:and>
                      <cis:evidence_test check="all" check_existence="none_exist"
                                         comment="Ensurefile(s) named ^\S+\.conf$ in /etc/sysctl.d/ exists and matches pattern ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"
                                         negated="false"
                                         ns="independent"
                                         objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806839"
                                         result="true"
                                         testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806839"
                                         type="textfilecontent54_test">
                         <cis:evidence_object>
                            <cis:evidence_item itemref="2206">
                               <cis:evidence_item_pk status="does not exist">
                                  <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                                  <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                                  <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                                  <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                               </cis:evidence_item_pk>
                            </cis:evidence_item>
                            <cis:evidence_item itemref="2207">
                               <cis:evidence_item_pk status="does not exist">
                                  <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                                  <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                                  <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                                  <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                               </cis:evidence_item_pk>
                            </cis:evidence_item>
                            <cis:evidence_item itemref="2208">
                               <cis:evidence_item_pk status="does not exist">
                                  <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                                  <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                                  <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                                  <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                               </cis:evidence_item_pk>
                            </cis:evidence_item>
                            <cis:evidence_item itemref="2209">
                               <cis:evidence_item_pk status="does not exist">
                                  <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                                  <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                                  <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                                  <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                               </cis:evidence_item_pk>
                            </cis:evidence_item>
                            <cis:evidence_item itemref="2210">
                               <cis:evidence_item_pk status="does not exist">
                                  <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                                  <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                                  <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                                  <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                               </cis:evidence_item_pk>
                            </cis:evidence_item>
                            <cis:evidence_item itemref="2211">
                               <cis:evidence_item_pk status="does not exist">
                                  <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                                  <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                                  <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                                  <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                               </cis:evidence_item_pk>
                            </cis:evidence_item>
                            <cis:evidence_item itemref="2212">
                               <cis:evidence_item_pk status="does not exist">
                                  <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                                  <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                                  <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                                  <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                               </cis:evidence_item_pk>
                            </cis:evidence_item>
                            <cis:evidence_item itemref="2213">
                               <cis:evidence_item_pk status="does not exist">
                                  <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                                  <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                                  <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                                  <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                               </cis:evidence_item_pk>
                            </cis:evidence_item>
                            <cis:evidence_item itemref="2214">
                               <cis:evidence_item_pk status="does not exist">
                                  <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                                  <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                                  <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                                  <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                               </cis:evidence_item_pk>
                            </cis:evidence_item>
                         </cis:evidence_object>
                      </cis:evidence_test>
                   </cis:and>
                   <cis:evidence_test check="all" check_existence="none_exist"
                                      comment="Ensurefile(s) named ^\S+\.conf$ in /usr/lib/sysctl.d/ exists and matches pattern ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"
                                      negated="false"
                                      ns="independent"
                                      objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806844"
                                      result="true"
                                      testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806844"
                                      type="textfilecontent54_test">
                      <cis:evidence_object>
                         <cis:evidence_item itemref="2216">
                            <cis:evidence_item_pk status="does not exist">
                               <cis:evidence_item_pk_field name="filepath" value="/usr/lib/sysctl.d/50-default.conf"/>
                               <cis:evidence_item_pk_field name="path" value="/usr/lib/sysctl.d"/>
                               <cis:evidence_item_pk_field name="filename" value="50-default.conf"/>
                               <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                            </cis:evidence_item_pk>
                         </cis:evidence_item>
                      </cis:evidence_object>
                   </cis:evidence_test>
                </cis:and>
                <cis:evidence_test check="all" check_existence="none_exist"
                                   comment="Ensurefile(s) named ^\S+\.conf$ in /run/sysctl.d/ exists and matches pattern ^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"
                                   negated="false"
                                   ns="independent"
                                   objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806850"
                                   result="true"
                                   testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806850"
                                   type="textfilecontent54_test">
                   <cis:evidence_object>
                      <cis:evidence_item itemref="2217">
                         <cis:evidence_item_pk status="does not exist">
                            <cis:evidence_item_pk_field name="path" value="/run/sysctl.d/"/>
                            <cis:evidence_item_pk_field name="filename" value="^\S+\.conf$"/>
                            <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv4\.ip_forward\s*=\s*1\s*"/>
                            <cis:evidence_item_pk_field name="instance" value="1"/>
                         </cis:evidence_item_pk>
                      </cis:evidence_item>
                   </cis:evidence_object>
                </cis:evidence_test>
             </cis:and>
             <cis:evidence_test comment="Ensure IP forwarding is disabled" result="unknown">
                <cis:evidence_sce exit-code="-1" full-path="" href="sce/sysctl_running_config.sh">
                   <cis:environment_variables>
                      <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                   </cis:environment_variables>
                </cis:evidence_sce>
             </cis:evidence_test>
          </cis:and>
          <cis:evidence_test check="all" check_existence="none_exist"
                             comment="Ensure no file named /etc/sysctl.conf exists and matches pattern ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806860"
                             result="true"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806860"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2218">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc"/>
                      <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
       </cis:and>
       <cis:evidence_test check="all" check_existence="none_exist"
                          comment="Ensurefile(s) named ^\S+\.conf$ in /etc/sysctl.d/ exists and matches pattern ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806864"
                          result="true"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806864"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2228">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2229">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2230">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2231">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2232">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2233">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2234">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2235">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2236">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:and>
    <cis:evidence_test check="all" check_existence="none_exist"
                       comment="Ensurefile(s) named ^\S+\.conf$ in /usr/lib/sysctl.d/ exists and matches pattern ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806867"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806867"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2238">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/usr/lib/sysctl.d/50-default.conf"/>
                <cis:evidence_item_pk_field name="path" value="/usr/lib/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="50-default.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensurefile(s) named ^\S+\.conf$ in /run/sysctl.d/ exists and matches pattern ^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806874"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806874"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2239">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="path" value="/run/sysctl.d/"/>
             <cis:evidence_item_pk_field name="filename" value="^\S+\.conf$"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*net\.ipv6\.conf\.all\.forwarding\s*=\s*1\s*"/>
             <cis:evidence_item_pk_field name="instance" value="1"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<xccdf:complex-check operator="AND">
<xccdf:complex-check operator="AND">
 <xccdf:complex-check operator="AND">
    <xccdf:complex-check operator="AND">
       <xccdf:complex-check operator="AND">
          <xccdf:complex-check operator="AND">
             <xccdf:complex-check operator="AND">
                <xccdf:complex-check operator="AND">
                   <check system="http://open-scap.org/page/SCE">
                      <check-import import-name="stdout"/>
                      <check-export export-name="XCCDF_VALUE_REGEX"
                                    value-id="xccdf_org.cisecurity.benchmarks_value_806830_var"/>
                      <check-content-ref href="sce/sysctl_running_config.sh"/>
                   </check>
                   <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
                      <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                                         name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806834"/>
                   </check>
                </xccdf:complex-check>
                <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
                   <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                                      name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806839"/>
                </check>
             </xccdf:complex-check>
             <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
                <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                                   name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806844"/>
             </check>
          </xccdf:complex-check>
          <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
             <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                                name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806850"/>
          </check>
       </xccdf:complex-check>
       <check system="http://open-scap.org/page/SCE">
          <check-import import-name="stdout"/>
          <check-export export-name="XCCDF_VALUE_REGEX"
                        value-id="xccdf_org.cisecurity.benchmarks_value_806856_var"/>
          <check-content-ref href="sce/sysctl_running_config.sh"/>
       </check>
    </xccdf:complex-check>
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806860"/>
    </check>
 </xccdf:complex-check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806864"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806867"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806874"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

3.2 Network Parameters (Host and Router)

The following network parameters are intended for use on both host only and router systems. A system acts as a router if it has at least two interfaces and is configured to perform routing functions.

Fail

3.2.1 Ensure source routed packets are not accepted

Description:

In networking, source routing allows a sender to partially or fully specify the route packets take through a network. In contrast, non-source routed packets travel a path determined by routers in the network. In some cases, systems may not be routable or reachable from some locations (e.g. private addresses vs. Internet routable), and so source routed packets would need to be used.

Setting net.ipv4.conf.all.accept_source_route, net.ipv4.conf.default.accept_source_route, net.ipv6.conf.all.accept_source_route and net.ipv6.conf.default.accept_source_route to 0 disables the system from accepting source routed packets. Assume this system was capable of routing packets to Internet routable addresses on one interface and private addresses on another interface. Assume that the private addresses were not routable to the Internet routable addresses and vice versa. Under normal routing circumstances, an attacker from the Internet routable addresses could not use the system as a way to reach the private address systems. If, however, source routed packets were allowed, they could be used to gain access to the private address systems as the route could be specified, rather than rely on routing protocols that did not allow this routing.

Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:

net.ipv4.conf.all.accept_source_route = 0
net.ipv4.conf.default.accept_source_route = 0
net.ipv6.conf.all.accept_source_route = 0
net.ipv6.conf.default.accept_source_route = 0

Run the following commands to set the active kernel parameters:

# sysctl -w net.ipv4.conf.all.accept_source_route=0
# sysctl -w net.ipv4.conf.default.accept_source_route=0
# sysctl -w net.ipv6.conf.all.accept_source_route=0
# sysctl -w net.ipv6.conf.default.accept_source_route=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1

All of the following tests or sub-groups must pass:
Ensure 'net.ipv6.conf.default.accept_source_route' kernel parameter Equals 0 (int) -- More
Check: All Must Pass
Kernel Parameter: net.ipv6.conf.default.accept_source_route
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv6.conf.default.accept_source_route net.ipv6.conf.default.accept_source_route
the Kernel Parameter Value to be set to 0 0
All of the following tests or sub-groups must pass:
Ensure 'net.ipv6.conf.all.accept_source_route' kernel parameter Equals 0 (int) -- More
Check: All Must Pass
Kernel Parameter: net.ipv6.conf.all.accept_source_route
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv6.conf.all.accept_source_route net.ipv6.conf.all.accept_source_route
the Kernel Parameter Value to be set to 0 0
All of the following tests or sub-groups must pass:
Ensure 'net.ipv4.conf.all.accept_source_route' kernel parameter Equals 0 (int) -- More
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.all.accept_source_route
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.all.accept_source_route net.ipv4.conf.all.accept_source_route
the Kernel Parameter Value to be set to 0 0
Ensure 'net.ipv4.conf.default.accept_source_route' kernel parameter Equals 0 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.default.accept_source_route
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.default.accept_source_route net.ipv4.conf.default.accept_source_route
the Kernel Parameter Value to be set to 0 1
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.all.accept_source_route' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv4.conf.all.accept_source_route' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.default.accept_source_route' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv4.conf.default.accept_source_route' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv6.conf.all.accept_source_route' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv6.conf.all.accept_source_route' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv6.conf.default.accept_source_route' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv6.conf.default.accept_source_route' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.2.1_Ensure_source_routed_packets_are_not_accepted"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:34.560+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:34.560+07:00"
         start-time="2022-01-05T01:03:34.494+07:00">
<cis:and>
 <cis:and>
    <cis:and>
       <cis:or result="false">
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure 'net.ipv4.conf.all.accept_source_route' kernel parameter Equals 0 (int)"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068842"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068842"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2240">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc"/>
                      <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure 'net.ipv4.conf.all.accept_source_route' kernel parameter Equals 0 (int)"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068843"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068843"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2251">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2252">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2253">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2254">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2255">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="README"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2256">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2257">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2258">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2259">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2260">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
       </cis:or>
       <cis:or result="false">
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure 'net.ipv4.conf.default.accept_source_route' kernel parameter Equals 0 (int)"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068932"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068932"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2261">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc"/>
                      <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure 'net.ipv4.conf.default.accept_source_route' kernel parameter Equals 0 (int)"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068933"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068933"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2272">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2273">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2274">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2275">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2276">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="README"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2277">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2278">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2279">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2280">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2281">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.accept_source_route\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
       </cis:or>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv4.conf.all.accept_source_route' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="unix"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068841"
                          result="true"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068841"
                          type="sysctl_test">
          <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8068841">
             <cis:evidence_item itemref="1438">
                <cis:evidence_item_pk status="exists">
                   <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.all.accept_source_route"/>
                </cis:evidence_item_pk>
                <cis:evidence_field cv="net.ipv4.conf.all.accept_source_route" dt="string"
                                    ev="net.ipv4.conf.all.accept_source_route"
                                    name="name"
                                    op="equals"
                                    result="true"/>
                <cis:evidence_field cv="0" dt="int" ev="0" name="value" op="equals" result="true"/>
             </cis:evidence_item>
          </cis:evidence_state>
       </cis:evidence_test>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv4.conf.default.accept_source_route' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="unix"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8068931"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8068931"
                          type="sysctl_test">
          <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8068931">
             <cis:evidence_item itemref="1469">
                <cis:evidence_item_pk status="exists">
                   <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.default.accept_source_route"/>
                </cis:evidence_item_pk>
                <cis:evidence_field cv="net.ipv4.conf.default.accept_source_route" dt="string"
                                    ev="net.ipv4.conf.default.accept_source_route"
                                    name="name"
                                    op="equals"
                                    result="true"/>
                <cis:evidence_field cv="1" dt="int" ev="0" name="value" op="equals" result="false"/>
             </cis:evidence_item>
          </cis:evidence_state>
       </cis:evidence_test>
    </cis:and>
    <cis:or result="false">
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv6.conf.all.accept_source_route' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069042"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069042"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2282">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc"/>
                   <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv6.conf.all.accept_source_route' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069043"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069043"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2293">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2294">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2295">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2296">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2297">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="README"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2298">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2299">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2300">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2301">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2302">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_source_route\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:or>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv6.conf.all.accept_source_route' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="unix"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069041"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069041"
                       type="sysctl_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8069041">
          <cis:evidence_item itemref="1743">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="name" value="net.ipv6.conf.all.accept_source_route"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="net.ipv6.conf.all.accept_source_route" dt="string"
                                 ev="net.ipv6.conf.all.accept_source_route"
                                 name="name"
                                 op="equals"
                                 result="true"/>
             <cis:evidence_field cv="0" dt="int" ev="0" name="value" op="equals" result="true"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
 </cis:and>
 <cis:or result="false">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv6.conf.default.accept_source_route' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069122"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069122"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2303">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv6.conf.default.accept_source_route' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069123"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069123"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2314">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2315">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2316">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2317">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2318">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2319">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2320">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2321">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2322">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2323">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_source_route\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv6.conf.default.accept_source_route' kernel parameter Equals 0 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069121"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069121"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8069121">
       <cis:evidence_item itemref="1791">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv6.conf.default.accept_source_route"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv6.conf.default.accept_source_route" dt="string"
                              ev="net.ipv6.conf.default.accept_source_route"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<xccdf:complex-check operator="AND">
<xccdf:complex-check operator="AND">
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806884"
                  value-id="xccdf_org.cisecurity.benchmarks_value_806884_var"/>
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806884"/>
 </check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806893"
                  value-id="xccdf_org.cisecurity.benchmarks_value_806893_var"/>
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806893"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806904"
               value-id="xccdf_org.cisecurity.benchmarks_value_806904_var"/>
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806904"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806912"
            value-id="xccdf_org.cisecurity.benchmarks_value_806912_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806912"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

3.2.2 Ensure ICMP redirects are not accepted

Description:

ICMP redirect messages are packets that convey routing information and tell your host (acting as a router) to send packets via an alternate path. It is a way of allowing an outside routing device to update your system routing tables. By setting net.ipv4.conf.all.accept_redirects and net.ipv6.conf.all.accept_redirects to 0, the system will not accept any ICMP redirect messages, and therefore, won't allow outsiders to update the system's routing tables.

Attackers could use bogus ICMP redirect messages to maliciously alter the system routing tables and get them to send packets to incorrect networks and allow your system packets to be captured.

Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:

net.ipv4.conf.all.accept_redirects = 0
net.ipv4.conf.default.accept_redirects = 0
net.ipv6.conf.all.accept_redirects = 0
net.ipv6.conf.default.accept_redirects = 0

Run the following commands to set the active kernel parameters:

# sysctl -w net.ipv4.conf.all.accept_redirects=0
# sysctl -w net.ipv4.conf.default.accept_redirects=0
# sysctl -w net.ipv6.conf.all.accept_redirects=0
# sysctl -w net.ipv6.conf.default.accept_redirects=0
# sysctl -w net.ipv4.route.flush=1
# sysctl -w net.ipv6.route.flush=1

All of the following tests or sub-groups must pass:
Ensure 'net.ipv6.conf.default.accept_redirects' kernel parameter Equals 0 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv6.conf.default.accept_redirects
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv6.conf.default.accept_redirects net.ipv6.conf.default.accept_redirects
the Kernel Parameter Value to be set to 0 1
All of the following tests or sub-groups must pass:
Ensure 'net.ipv6.conf.all.accept_redirects' kernel parameter Equals 0 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv6.conf.all.accept_redirects
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv6.conf.all.accept_redirects net.ipv6.conf.all.accept_redirects
the Kernel Parameter Value to be set to 0 1
All of the following tests or sub-groups must pass:
Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.all.accept_redirects
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.all.accept_redirects net.ipv4.conf.all.accept_redirects
the Kernel Parameter Value to be set to 0 1
Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.all.accept_redirects
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.all.accept_redirects net.ipv4.conf.all.accept_redirects
the Kernel Parameter Value to be set to 0 1
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv6.conf.all.accept_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv6.conf.all.accept_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv6.conf.default.accept_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv6.conf.default.accept_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.2.2_Ensure_ICMP_redirects_are_not_accepted"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:34.723+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:34.724+07:00"
         start-time="2022-01-05T01:03:34.625+07:00">
<cis:and>
 <cis:and>
    <cis:and>
       <cis:or result="false">
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int)"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069272"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069272"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2324">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc"/>
                      <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int)"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069273"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069273"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2335">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2336">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2337">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2338">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2339">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="README"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2340">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2341">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2342">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2343">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2344">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
       </cis:or>
       <cis:or result="false">
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int)"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069342"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069342"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2345">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc"/>
                      <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int)"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069343"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069343"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2356">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2357">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2358">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2359">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2360">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="README"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2361">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2362">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2363">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2364">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2365">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                      <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.accept_redirects\s*=\s*0$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
       </cis:or>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="unix"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069271"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069271"
                          type="sysctl_test">
          <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8069271">
             <cis:evidence_item itemref="1437">
                <cis:evidence_item_pk status="exists">
                   <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.all.accept_redirects"/>
                </cis:evidence_item_pk>
                <cis:evidence_field cv="net.ipv4.conf.all.accept_redirects" dt="string"
                                    ev="net.ipv4.conf.all.accept_redirects"
                                    name="name"
                                    op="equals"
                                    result="true"/>
                <cis:evidence_field cv="1" dt="int" ev="0" name="value" op="equals" result="false"/>
             </cis:evidence_item>
          </cis:evidence_state>
       </cis:evidence_test>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv4.conf.all.accept_redirects' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="unix"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069341"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069341"
                          type="sysctl_test">
          <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8069341">
             <cis:evidence_item itemref="1437">
                <cis:evidence_item_pk status="exists">
                   <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.all.accept_redirects"/>
                </cis:evidence_item_pk>
                <cis:evidence_field cv="net.ipv4.conf.all.accept_redirects" dt="string"
                                    ev="net.ipv4.conf.all.accept_redirects"
                                    name="name"
                                    op="equals"
                                    result="true"/>
                <cis:evidence_field cv="1" dt="int" ev="0" name="value" op="equals" result="false"/>
             </cis:evidence_item>
          </cis:evidence_state>
       </cis:evidence_test>
    </cis:and>
    <cis:or result="false">
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv6.conf.all.accept_redirects' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069412"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069412"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2366">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc"/>
                   <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv6.conf.all.accept_redirects' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069413"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069413"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2377">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2378">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2379">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2380">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2381">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="README"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2382">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2383">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2384">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2385">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2386">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_redirects\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:or>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv6.conf.all.accept_redirects' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="unix"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069411"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069411"
                       type="sysctl_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8069411">
          <cis:evidence_item itemref="1742">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="name" value="net.ipv6.conf.all.accept_redirects"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="net.ipv6.conf.all.accept_redirects" dt="string"
                                 ev="net.ipv6.conf.all.accept_redirects"
                                 name="name"
                                 op="equals"
                                 result="true"/>
             <cis:evidence_field cv="1" dt="int" ev="0" name="value" op="equals" result="false"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
 </cis:and>
 <cis:or result="false">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv6.conf.default.accept_redirects' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069522"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069522"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2387">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv6.conf.default.accept_redirects' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069523"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069523"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2398">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2399">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2400">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2401">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2402">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2403">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2404">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2405">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2406">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2407">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv6.conf.default.accept_redirects' kernel parameter Equals 0 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069521"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069521"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8069521">
       <cis:evidence_item itemref="1790">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv6.conf.default.accept_redirects"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv6.conf.default.accept_redirects" dt="string"
                              ev="net.ipv6.conf.default.accept_redirects"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="1" dt="int" ev="0" name="value" op="equals" result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<xccdf:complex-check operator="AND">
<xccdf:complex-check operator="AND">
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806927"
                  value-id="xccdf_org.cisecurity.benchmarks_value_806927_var"/>
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806927"/>
 </check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806934"
                  value-id="xccdf_org.cisecurity.benchmarks_value_806934_var"/>
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806934"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806941"
               value-id="xccdf_org.cisecurity.benchmarks_value_806941_var"/>
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806941"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806952"
            value-id="xccdf_org.cisecurity.benchmarks_value_806952_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806952"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

3.2.3 Ensure secure ICMP redirects are not accepted

Description:

Secure ICMP redirects are the same as ICMP redirects, except they come from gateways listed on the default gateway list. It is assumed that these gateways are known to your system, and that they are likely to be secure.

It is still possible for even known gateways to be compromised. Setting net.ipv4.conf.all.secure_redirects to 0 protects the system from routing table updates by possibly compromised known gateways.

Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:

net.ipv4.conf.all.secure_redirects = 0
net.ipv4.conf.default.secure_redirects = 0

Run the following commands to set the active kernel parameters:

# sysctl -w net.ipv4.conf.all.secure_redirects=0
# sysctl -w net.ipv4.conf.default.secure_redirects=0
# sysctl -w net.ipv4.route.flush=1

All of the following tests or sub-groups must pass:
Ensure 'net.ipv4.conf.all.secure_redirects' kernel parameter Equals 0 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.all.secure_redirects
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.all.secure_redirects net.ipv4.conf.all.secure_redirects
the Kernel Parameter Value to be set to 0 1
Ensure 'net.ipv4.conf.default.secure_redirects' kernel parameter Equals 0 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.default.secure_redirects
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.default.secure_redirects net.ipv4.conf.default.secure_redirects
the Kernel Parameter Value to be set to 0 1
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.all.secure_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv4.conf.all.secure_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.default.secure_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv4.conf.default.secure_redirects' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.2.3_Ensure_secure_ICMP_redirects_are_not_accepted"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:34.792+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:34.822+07:00"
         start-time="2022-01-05T01:03:34.749+07:00">
<cis:and>
 <cis:or result="false">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.all.secure_redirects' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069622"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069622"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2408">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.all.secure_redirects' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069623"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069623"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2419">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2420">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2421">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2422">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2423">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2424">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2425">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2426">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2427">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2428">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:or result="false">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.default.secure_redirects' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069692"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069692"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2429">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.default.secure_redirects' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069693"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069693"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2440">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2441">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2442">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2443">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2444">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2445">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2446">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2447">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2448">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2449">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.secure_redirects\s*=\s*0$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv4.conf.all.secure_redirects' kernel parameter Equals 0 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069621"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069621"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8069621">
       <cis:evidence_item itemref="1462">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.all.secure_redirects"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv4.conf.all.secure_redirects" dt="string"
                              ev="net.ipv4.conf.all.secure_redirects"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="1" dt="int" ev="0" name="value" op="equals" result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv4.conf.default.secure_redirects' kernel parameter Equals 0 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069691"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069691"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8069691">
       <cis:evidence_item itemref="1493">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.default.secure_redirects"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv4.conf.default.secure_redirects" dt="string"
                              ev="net.ipv4.conf.default.secure_redirects"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="1" dt="int" ev="0" name="value" op="equals" result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806962"
            value-id="xccdf_org.cisecurity.benchmarks_value_806962_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806962"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806969"
            value-id="xccdf_org.cisecurity.benchmarks_value_806969_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806969"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

3.2.4 Ensure suspicious packets are logged

Description:

When enabled, this feature logs packets with un-routable source addresses to the kernel log.

Enabling this feature and logging these packets allows an administrator to investigate the possibility that an attacker is sending spoofed packets to their system.

Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:

net.ipv4.conf.all.log_martians = 1
net.ipv4.conf.default.log_martians = 1

Run the following commands to set the active kernel parameters:

# sysctl -w net.ipv4.conf.all.log_martians=1
# sysctl -w net.ipv4.conf.default.log_martians=1
# sysctl -w net.ipv4.route.flush=1

All of the following tests or sub-groups must pass:
Ensure 'net.ipv4.conf.all.log_martians' kernel parameter Equals 1 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.all.log_martians
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.all.log_martians net.ipv4.conf.all.log_martians
the Kernel Parameter Value to be set to 1 0
Ensure 'net.ipv4.conf.default.log_martians' kernel parameter Equals 1 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.default.log_martians
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.default.log_martians net.ipv4.conf.default.log_martians
the Kernel Parameter Value to be set to 1 0
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.all.log_martians' kernel parameter Equals 1 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.log_martians\s*=\s*1$
Match Text: No match found
Ensure 'net.ipv4.conf.all.log_martians' kernel parameter Equals 1 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.all.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.log_martians\s*=\s*1$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.default.log_martians' kernel parameter Equals 1 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.log_martians\s*=\s*1$
Match Text: No match found
Ensure 'net.ipv4.conf.default.log_martians' kernel parameter Equals 1 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.default.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.log_martians\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.log_martians\s*=\s*1$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.2.4_Ensure_suspicious_packets_are_logged"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:34.911+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/3"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:34.911+07:00"
         start-time="2022-01-05T01:03:34.859+07:00">
<cis:and>
 <cis:or result="false">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.all.log_martians' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069862"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069862"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2450">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.all.log_martians' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069863"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069863"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2461">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2462">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2463">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2464">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2465">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2466">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2467">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2468">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2469">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2470">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:or result="false">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.default.log_martians' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069952"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069952"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2471">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.default.log_martians' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069953"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069953"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2482">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2483">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2484">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2485">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2486">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2487">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2488">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2489">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2490">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2491">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.log_martians\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv4.conf.all.log_martians' kernel parameter Equals 1 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069861"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069861"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8069861">
       <cis:evidence_item itemref="1454">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.all.log_martians"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv4.conf.all.log_martians" dt="string"
                              ev="net.ipv4.conf.all.log_martians"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="1" name="value" op="equals" result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv4.conf.default.log_martians' kernel parameter Equals 1 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8069951"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8069951"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8069951">
       <cis:evidence_item itemref="1485">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.default.log_martians"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv4.conf.default.log_martians" dt="string"
                              ev="net.ipv4.conf.default.log_martians"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="1" name="value" op="equals" result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806986"
            value-id="xccdf_org.cisecurity.benchmarks_value_806986_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806986"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806995"
            value-id="xccdf_org.cisecurity.benchmarks_value_806995_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806995"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:
  • http://cisecurity.org/20-cc/v7.0:

Fail

3.2.5 Ensure broadcast ICMP requests are ignored

Description:

Setting net.ipv4.icmp_echo_ignore_broadcasts to 1 will cause the system to ignore all ICMP echo and timestamp requests to broadcast and multicast addresses.

Accepting ICMP echo and timestamp requests with broadcast or multicast destinations for your network could be used to trick your host into starting (or participating) in a Smurf attack. A Smurf attack relies on an attacker sending large amounts of ICMP broadcast messages with a spoofed source address. All hosts receiving this message and responding would send echo-reply messages back to the spoofed address, which is probably not routable. If many hosts respond to the packets, the amount of traffic on the network could be significantly multiplied.

Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:

net.ipv4.icmp_echo_ignore_broadcasts = 1

Run the following commands to set the active kernel parameters:

# sysctl -w net.ipv4.icmp_echo_ignore_broadcasts=1 # sysctl -w net.ipv4.route.flush=1

All of the following tests or sub-groups must pass:
Ensure 'net.ipv4.icmp_echo_ignore_broadcasts' kernel parameter Equals 1 (int) -- More
Check: All Must Pass
Kernel Parameter: net.ipv4.icmp_echo_ignore_broadcasts
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.icmp_echo_ignore_broadcasts net.ipv4.icmp_echo_ignore_broadcasts
the Kernel Parameter Value to be set to 1 1
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.icmp_echo_ignore_broadcasts' kernel parameter Equals 1 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$
Match Text: No match found
Ensure 'net.ipv4.icmp_echo_ignore_broadcasts' kernel parameter Equals 1 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.2.5_Ensure_broadcast_ICMP_requests_are_ignored"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:34.959+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:34.961+07:00"
         start-time="2022-01-05T01:03:34.931+07:00">
<cis:and>
 <cis:or result="false">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.icmp_echo_ignore_broadcasts' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070182"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070182"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2492">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.icmp_echo_ignore_broadcasts' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070183"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070183"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2503">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2504">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2505">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2506">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2507">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2508">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2509">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2510">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2511">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2512">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_echo_ignore_broadcasts\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv4.icmp_echo_ignore_broadcasts' kernel parameter Equals 1 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070181"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070181"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8070181">
       <cis:evidence_item itemref="1564">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv4.icmp_echo_ignore_broadcasts"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv4.icmp_echo_ignore_broadcasts" dt="string"
                              ev="net.ipv4.icmp_echo_ignore_broadcasts"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="1" dt="int" ev="1" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807018"
            value-id="xccdf_org.cisecurity.benchmarks_value_807018_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807018"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

3.2.6 Ensure bogus ICMP responses are ignored

Description:

Setting icmp_ignore_bogus_error_responses to 1 prevents the kernel from logging bogus responses (RFC-1122 non-compliant) from broadcast reframes, keeping file systems from filling up with useless log messages.

Some routers (and some attackers) will send responses that violate RFC-1122 and attempt to fill up a log file system with many useless error messages.

Set the following parameter in /etc/sysctl.conf or a /etc/sysctl.d/* file:

net.ipv4.icmp_ignore_bogus_error_responses = 1

Run the following commands to set the active kernel parameters:

# sysctl -w net.ipv4.icmp_ignore_bogus_error_responses=1 # sysctl -w net.ipv4.route.flush=1

All of the following tests or sub-groups must pass:
Ensure 'net.ipv4.icmp_ignore_bogus_error_responses' kernel parameter Equals 1 (int) -- More
Check: All Must Pass
Kernel Parameter: net.ipv4.icmp_ignore_bogus_error_responses
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.icmp_ignore_bogus_error_responses net.ipv4.icmp_ignore_bogus_error_responses
the Kernel Parameter Value to be set to 1 1
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.icmp_ignore_bogus_error_responses' kernel parameter Equals 1 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$
Match Text: No match found
Ensure 'net.ipv4.icmp_ignore_bogus_error_responses' kernel parameter Equals 1 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.2.6_Ensure_bogus_ICMP_responses_are_ignored"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:35.001+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:35.001+07:00"
         start-time="2022-01-05T01:03:34.978+07:00">
<cis:and>
 <cis:or result="false">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.icmp_ignore_bogus_error_responses' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070302"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070302"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2513">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.icmp_ignore_bogus_error_responses' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070303"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070303"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2524">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2525">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2526">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2527">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2528">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2529">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2530">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2531">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2532">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2533">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.icmp_ignore_bogus_error_responses\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv4.icmp_ignore_bogus_error_responses' kernel parameter Equals 1 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070301"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070301"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8070301">
       <cis:evidence_item itemref="1566">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv4.icmp_ignore_bogus_error_responses"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv4.icmp_ignore_bogus_error_responses" dt="string"
                              ev="net.ipv4.icmp_ignore_bogus_error_responses"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="1" dt="int" ev="1" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807030"
            value-id="xccdf_org.cisecurity.benchmarks_value_807030_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807030"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

3.2.7 Ensure Reverse Path Filtering is enabled

Description:

Setting net.ipv4.conf.all.rp_filter and net.ipv4.conf.default.rp_filter to 1 forces the Linux kernel to utilize reverse path filtering on a received packet to determine if the packet was valid. Essentially, with reverse path filtering, if the return packet does not go out the same interface that the corresponding source packet came from, the packet is dropped (and logged if log_martians is set).

Setting these flags is a good way to deter attackers from sending your system bogus packets that cannot be responded to. One instance where this feature breaks down is if asymmetrical routing is employed. This would occur when using dynamic routing protocols (bgp, ospf, etc) on your system. If you are using asymmetrical routing on your system, you will not be able to enable this feature without breaking the routing.

Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:

net.ipv4.conf.all.rp_filter = 1
net.ipv4.conf.default.rp_filter = 1

Run the following commands to set the active kernel parameters:

# sysctl -w net.ipv4.conf.all.rp_filter=1 # sysctl -w net.ipv4.conf.default.rp_filter=1 # sysctl -w net.ipv4.route.flush=1

All of the following tests or sub-groups must pass:
Ensure 'net.ipv4.conf.all.rp_filter' kernel parameter Equals 1 (int) -- More
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.all.rp_filter
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.all.rp_filter net.ipv4.conf.all.rp_filter
the Kernel Parameter Value to be set to 1 1
Ensure 'net.ipv4.conf.default.rp_filter' kernel parameter Equals 1 (int) -- More
Check: All Must Pass
Kernel Parameter: net.ipv4.conf.default.rp_filter
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.conf.default.rp_filter net.ipv4.conf.default.rp_filter
the Kernel Parameter Value to be set to 1 1
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.all.rp_filter' kernel parameter Equals 1 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$
Match Text: No match found
Ensure 'net.ipv4.conf.all.rp_filter' kernel parameter Equals 1 (int) -- More
CIS-CAT expected at least 1 matching text file content item to be collected, and found 1 item.
File: /etc/sysctl.d/10-network-security.conf exists
Pattern: ^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$
Match Text: net.ipv4.conf.all.rp_filter=1
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.conf.default.rp_filter' kernel parameter Equals 1 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$
Match Text: No match found
Ensure 'net.ipv4.conf.default.rp_filter' kernel parameter Equals 1 (int) -- More
CIS-CAT expected at least 1 matching text file content item to be collected, and found 1 item.
File: /etc/sysctl.d/10-network-security.conf exists
Pattern: ^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$
Match Text: net.ipv4.conf.default.rp_filter=1
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.2.7_Ensure_Reverse_Path_Filtering_is_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:35.118+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:35.119+07:00"
         start-time="2022-01-05T01:03:35.082+07:00">
<cis:and>
 <cis:or result="true">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.all.rp_filter' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070532"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070532"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2534">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.all.rp_filter' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070533"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070533"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2545">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$"/>
                <cis:evidence_item_pk_field name="instance" value="1"/>
                <cis:evidence_item_pk_field name="text" value="net.ipv4.conf.all.rp_filter=1"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2546">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2547">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2548">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2549">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2550">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2551">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2552">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2553">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2554">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.all.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:or result="true">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.default.rp_filter' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070602"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070602"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2555">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.conf.default.rp_filter' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070603"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070603"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2566">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$"/>
                <cis:evidence_item_pk_field name="instance" value="1"/>
                <cis:evidence_item_pk_field name="text" value="net.ipv4.conf.default.rp_filter=1"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2567">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2568">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2569">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2570">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2571">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2572">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2573">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2574">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2575">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.conf.default.rp_filter\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv4.conf.all.rp_filter' kernel parameter Equals 1 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070531"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070531"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8070531">
       <cis:evidence_item itemref="1461">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.all.rp_filter"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv4.conf.all.rp_filter" dt="string" ev="net.ipv4.conf.all.rp_filter"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="1" dt="int" ev="1" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv4.conf.default.rp_filter' kernel parameter Equals 1 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070601"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070601"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8070601">
       <cis:evidence_item itemref="1492">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv4.conf.default.rp_filter"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv4.conf.default.rp_filter" dt="string"
                              ev="net.ipv4.conf.default.rp_filter"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="1" dt="int" ev="1" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807053"
            value-id="xccdf_org.cisecurity.benchmarks_value_807053_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807053"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807060"
            value-id="xccdf_org.cisecurity.benchmarks_value_807060_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807060"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

3.2.8 Ensure TCP SYN Cookies is enabled

Description:

When tcp_syncookies is set, the kernel will handle TCP SYN packets normally until the half-open connection queue is full, at which time, the SYN cookie functionality kicks in. SYN cookies work by not using the SYN queue at all. Instead, the kernel simply replies to the SYN with a SYN|ACK, but will include a specially crafted TCP sequence number that encodes the source and destination IP address and port number and the time the packet was sent. A legitimate connection would send the ACK packet of the three way handshake with the specially crafted sequence number. This allows the system to verify that it has received a valid response to a SYN cookie and allow the connection, even though there is no corresponding SYN in the queue.

Attackers use SYN flood attacks to perform a denial of service attacked on a system by sending many SYN packets without completing the three way handshake. This will quickly use up slots in the kernel's half-open connection queue and prevent legitimate connections from succeeding. SYN cookies allow the system to keep accepting valid connections, even if under a denial of service attack.

Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:

net.ipv4.tcp_syncookies = 1

Run the following commands to set the active kernel parameters:

# sysctl -w net.ipv4.tcp_syncookies=1 # sysctl -w net.ipv4.route.flush=1

All of the following tests or sub-groups must pass:
Ensure 'net.ipv4.tcp_syncookies' kernel parameter Equals 1 (int) -- More
Check: All Must Pass
Kernel Parameter: net.ipv4.tcp_syncookies
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv4.tcp_syncookies net.ipv4.tcp_syncookies
the Kernel Parameter Value to be set to 1 1
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv4.tcp_syncookies' kernel parameter Equals 1 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.tcp_syncookies\s*=\s*1$
Match Text: No match found
Ensure 'net.ipv4.tcp_syncookies' kernel parameter Equals 1 (int) -- More
CIS-CAT expected at least 1 matching text file content item to be collected, and found 1 item.
File: /etc/sysctl.d/10-network-security.conf exists
Pattern: ^\s*net.ipv4.tcp_syncookies\s*=\s*1$
Match Text: net.ipv4.tcp_syncookies=1
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv4.tcp_syncookies\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv4.tcp_syncookies\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv4.tcp_syncookies\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv4.tcp_syncookies\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv4.tcp_syncookies\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv4.tcp_syncookies\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv4.tcp_syncookies\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv4.tcp_syncookies\s*=\s*1$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv4.tcp_syncookies\s*=\s*1$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.2.8_Ensure_TCP_SYN_Cookies_is_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:35.196+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:35.196+07:00"
         start-time="2022-01-05T01:03:35.180+07:00">
<cis:and>
 <cis:or result="true">
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.tcp_syncookies' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070802"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070802"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2576">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.tcp_syncookies\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv4.tcp_syncookies' kernel parameter Equals 1 (int)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070803"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070803"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2587">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.tcp_syncookies\s*=\s*1$"/>
                <cis:evidence_item_pk_field name="instance" value="1"/>
                <cis:evidence_item_pk_field name="text" value="net.ipv4.tcp_syncookies=1"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2588">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.tcp_syncookies\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2589">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.tcp_syncookies\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2590">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.tcp_syncookies\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2591">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="README"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.tcp_syncookies\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2592">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.tcp_syncookies\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2593">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.tcp_syncookies\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2594">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.tcp_syncookies\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2595">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.tcp_syncookies\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2596">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv4.tcp_syncookies\s*=\s*1$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure 'net.ipv4.tcp_syncookies' kernel parameter Equals 1 (int)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070801"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070801"
                    type="sysctl_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8070801">
       <cis:evidence_item itemref="1713">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="net.ipv4.tcp_syncookies"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="net.ipv4.tcp_syncookies" dt="string" ev="net.ipv4.tcp_syncookies"
                              name="name"
                              op="equals"
                              result="true"/>
          <cis:evidence_field cv="1" dt="int" ev="1" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807080"
            value-id="xccdf_org.cisecurity.benchmarks_value_807080_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807080"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

3.2.9 Ensure IPv6 router advertisements are not accepted

Description:

This setting disables the system's ability to accept IPv6 router advertisements.

It is recommended that systems do not accept router advertisements as they could be tricked into routing traffic to compromised machines. Setting hard routes within the system (usually a single default route to a trusted router) protects the system from bad routes.

Set the following parameters in /etc/sysctl.conf or a /etc/sysctl.d/* file:

net.ipv6.conf.all.accept_ra = 0
net.ipv6.conf.default.accept_ra = 0

Run the following commands to set the active kernel parameters:

# sysctl -w net.ipv6.conf.all.accept_ra=0 # sysctl -w net.ipv6.conf.default.accept_ra=0 # sysctl -w net.ipv6.route.flush=1

Any of the following tests or sub-groups may pass:
Ensure /boot/grub/grub.cfg contents Pattern Match ipv6\.disable=1 (string) -- Less
File: /boot/grub/grub.cfg
Pattern: ^[^#]\s*linux.*$
Match Text: linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro quiet splash $vt_handoff
CIS-CAT Expected... CIS-CAT Collected...
the collected item's text matches the regular expression ipv6\.disable=1 linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro quiet splash $vt_handoff
All of the following tests or sub-groups must pass:
Ensure 'net.ipv6.conf.all.accept_ra' kernel parameter Equals 0 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv6.conf.all.accept_ra
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv6.conf.all.accept_ra net.ipv6.conf.all.accept_ra
the Kernel Parameter Value to be set to 0 1
Ensure 'net.ipv6.conf.default.accept_ra' kernel parameter Equals 0 (int) -- Less
Check: All Must Pass
Kernel Parameter: net.ipv6.conf.default.accept_ra
CIS-CAT Expected... CIS-CAT Collected...
the Kernel Parameter Name to be set to net.ipv6.conf.default.accept_ra net.ipv6.conf.default.accept_ra
the Kernel Parameter Value to be set to 0 1
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv6.conf.all.accept_ra' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv6.conf.all.accept_ra' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure 'net.ipv6.conf.default.accept_ra' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$
Match Text: No match found
Ensure 'net.ipv6.conf.default.accept_ra' kernel parameter Equals 0 (int) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysctl.d/10-network-security.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ptrace.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-zeropage.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-kernel-hardening.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/README does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-link-restrictions.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-console-messages.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-magic-sysrq.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.d/10-ipv6-privacy.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$
Match Text: No match found
File: /etc/sysctl.conf does not exist
Pattern: ^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.2.9_Ensure_IPv6_router_advertisements_are_not_accepted"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:35.320+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:35.320+07:00"
         start-time="2022-01-05T01:03:35.272+07:00">
<cis:or>
 <cis:and>
    <cis:or result="false">
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv6.conf.all.accept_ra' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8071002"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8071002"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2597">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc"/>
                   <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv6.conf.all.accept_ra' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8071003"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8071003"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2608">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2609">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2610">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2611">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2612">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="README"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2613">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2614">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2615">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2616">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2617">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.all.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:or>
    <cis:or result="false">
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv6.conf.default.accept_ra' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8071062"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8071062"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2618">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc"/>
                   <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure 'net.ipv6.conf.default.accept_ra' kernel parameter Equals 0 (int)"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8071063"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8071063"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2629">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-network-security.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-network-security.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2630">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ptrace.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-ptrace.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2631">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-zeropage.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-zeropage.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2632">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-kernel-hardening.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-kernel-hardening.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2633">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/README"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="README"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2634">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-link-restrictions.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-link-restrictions.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2635">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-console-messages.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-console-messages.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2636">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-magic-sysrq.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-magic-sysrq.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2637">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.d/10-ipv6-privacy.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="10-ipv6-privacy.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2638">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/sysctl.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/sysctl.d"/>
                   <cis:evidence_item_pk_field name="filename" value="sysctl.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*net.ipv6.conf.default.accept_ra\s*=\s*0$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:or>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv6.conf.all.accept_ra' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="unix"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8071001"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8071001"
                       type="sysctl_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8071001">
          <cis:evidence_item itemref="1733">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="name" value="net.ipv6.conf.all.accept_ra"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="net.ipv6.conf.all.accept_ra" dt="string" ev="net.ipv6.conf.all.accept_ra"
                                 name="name"
                                 op="equals"
                                 result="true"/>
             <cis:evidence_field cv="1" dt="int" ev="0" name="value" op="equals" result="false"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure 'net.ipv6.conf.default.accept_ra' kernel parameter Equals 0 (int)"
                       negated="false"
                       ns="unix"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8071061"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8071061"
                       type="sysctl_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:8071061">
          <cis:evidence_item itemref="1781">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="name" value="net.ipv6.conf.default.accept_ra"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="net.ipv6.conf.default.accept_ra" dt="string"
                                 ev="net.ipv6.conf.default.accept_ra"
                                 name="name"
                                 op="equals"
                                 result="true"/>
             <cis:evidence_field cv="1" dt="int" ev="0" name="value" op="equals" result="false"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
 </cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure /boot/grub/grub.cfg contents Pattern Match ipv6\.disable=1 (string)"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807113"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807113"
                    type="textfilecontent54_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807113">
       <cis:evidence_item itemref="2639">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/boot/grub/grub.cfg"/>
             <cis:evidence_item_pk_field name="path" value="/boot/grub"/>
             <cis:evidence_item_pk_field name="filename" value="grub.cfg"/>
             <cis:evidence_item_pk_field name="pattern" value="^[^#]\s*linux.*$"/>
             <cis:evidence_item_pk_field name="instance" value="1"/>
             <cis:evidence_item_pk_field name="text"
                                         value="        linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro  quiet splash $vt_handoff"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="        linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro  quiet splash $vt_handoff"
                              dt="string"
                              ev="ipv6\.disable=1"
                              name="text"
                              op="pattern match"
                              result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807100"
               value-id="xccdf_org.cisecurity.benchmarks_value_807100_var"/>
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807100"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807106"
               value-id="xccdf_org.cisecurity.benchmarks_value_807106_var"/>
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807106"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807113"
            value-id="xccdf_org.cisecurity.benchmarks_value_8071131_var"/>
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:8071132"
            value-id="xccdf_org.cisecurity.benchmarks_value_8071132_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807113"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

3.3 TCP Wrappers

Informational

3.3.1 Ensure TCP Wrappers is installed

Description:

Many Linux distributions provide value-added firewall solutions which provide easy, advanced management of network traffic into and out of the local system. When these solutions are available and appropriate for an environment they should be used.

In cases where a value-added firewall is not provided by a distribution, TCP Wrappers provides a simple access list and standardized logging method for services capable of supporting it. Services that are called from inetd and xinetd support the use of TCP wrappers. Any service that can support TCP wrappers will have the libwrap.so library attached to it.

TCP Wrappers provide a good simple access list mechanism to services that may not have that support built in. It is recommended that all services that can support TCP Wrappers, use it.

Run the following command to install TCP Wrappers:

# apt install tcpd

Impact:

Some Linux distributions have deprecated the use of TCP Wrappers in favor of value-added firewall solutions. In these cases the provided firewall solution should be used.

Ensure package name equals 'tcpd' is installed -- Less
CIS-CAT expected to collect at least 1 matching dpkg Package, and found 0 items.
Package Name: tcpd does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.3.1_Ensure_TCP_Wrappers_is_installed"
  role="unscored"
  severity="unknown"
  time="2022-01-05T01:03:35.423+07:00"
  version="1"
  weight="0.0">
<result>informational</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:35.424+07:00"
         start-time="2022-01-05T01:03:35.363+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure package name equals 'tcpd' is installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806898"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806898"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2640">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="tcpd"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806898"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Informational

3.3.2 Ensure /etc/hosts.allow is configured

Description:

The /etc/hosts.allow file specifies which IP addresses are permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.deny file.

The /etc/hosts.allow file supports access control by IP and helps ensure that only authorized systems can connect to the system.

Run the following command to create /etc/hosts.allow :

# echo "ALL: <net>/<mask>, <net>/<mask>, ..." >/etc/hosts.allow

where each <net>/<mask> combination (for example, "192.168.1.0/255.255.255.0") represents one network block in use by your organization that requires access to this system.

Any of the following tests or sub-groups may pass:
Ensure at least one file named /etc/hosts.allow exists and unknown test -- More
CIS-CAT expected at least 1 matching file item to be collected, and found 1 item.
File: /etc/hosts.allow exists
Ensure package name equals 'tcpd' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: tcpd does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.3.2_Ensure_etchosts.allow_is_configured"
  role="unscored"
  severity="unknown"
  time="2022-01-05T01:03:35.522+07:00"
  version="1"
  weight="0.0">
<result>informational</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:35.522+07:00"
         start-time="2022-01-05T01:03:35.455+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/hosts.allow exists and unknown test"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806914"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806914"
                    type="file_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2641">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/hosts.allow"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="hosts.allow"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'tcpd' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806918"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806918"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2642">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="tcpd"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806914"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806918"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Informational

3.3.3 Ensure /etc/hosts.deny is configured

Description:

The /etc/hosts.deny file specifies which IP addresses are not permitted to connect to the host. It is intended to be used in conjunction with the /etc/hosts.allow file.

The /etc/hosts.deny file serves as a failsafe so that any host not specified in /etc/hosts.allow is denied access to the system.

Run the following command to create /etc/hosts.deny :

# echo "ALL: ALL" >> /etc/hosts.deny

Any of the following tests or sub-groups may pass:
Ensure package name equals 'tcpd' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: tcpd does not exist
Ensure at least one file named /etc/hosts.deny exists and matches pattern ^ALL: ALL -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/hosts.deny does not exist
Pattern: ^ALL: ALL
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.3.3_Ensure_etchosts.deny_is_configured"
  role="unscored"
  severity="unknown"
  time="2022-01-05T01:03:35.673+07:00"
  version="1"
  weight="0.0">
<result>informational</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:35.673+07:00"
         start-time="2022-01-05T01:03:35.604+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'tcpd' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806940"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806940"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2643">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="tcpd"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/hosts.deny exists and matches pattern ^ALL: ALL"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806935"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806935"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2644">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/hosts.deny"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="hosts.deny"/>
             <cis:evidence_item_pk_field name="pattern" value="^ALL: ALL"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806935"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806940"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

3.3.4 Ensure permissions on /etc/hosts.allow are configured

Description:

The /etc/hosts.allow file contains networking information that is used by many applications and therefore must be readable for these applications to operate.

It is critical to ensure that the /etc/hosts.allow file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions.

Run the following commands to set permissions on /etc/hosts.allow :

# chown root:root /etc/hosts.allow
# chmod 644 /etc/hosts.allow

Any of the following tests or sub-groups may pass:
Ensure at least one file named /etc/hosts.allow exists and is owned by 0:0 and has permissions rw-r--r-- and does not have permissions --x-wx-wx SUID SGID sticky -- More
File: /etc/hosts.allow
CIS-CAT Expected... CIS-CAT Collected...
the file's Owner Write to be set to true true
the file's Group Execute to be set to false false
the file's Owner Execute to be set to false false
the file's SUID to be set to false false
the file's Other Execute to be set to false false
the file's Owner Read to be set to true true
the file's Other Read to be set to true true
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Sticky Bit to be set to false false
the file's SGID to be set to false false
the file's Other Write to be set to false false
the file's Group Read to be set to true true
the file's Group Write to be set to false false
Ensure no file named /etc/hosts.allow exists and unknown test -- Less
CIS-CAT did not expect to collect any file items, and found 1 item.
File: /etc/hosts.allow exists

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.3.4_Ensure_permissions_on_etchosts.allow_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:35.741+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:35.741+07:00"
         start-time="2022-01-05T01:03:35.690+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/hosts.allow exists and is owned by 0:0 and has permissions rw-r--r-- and does not have permissions --x-wx-wx SUID SGID sticky"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806958"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806958"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806958">
       <cis:evidence_item itemref="2645">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/hosts.allow"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="hosts.allow"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="true" dt="boolean" ev="true" name="uwrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="uexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="suid" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="true" name="uread" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="true" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="sticky" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="sgid" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="true" name="gread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure no file named /etc/hosts.allow exists and unknown test"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806972"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806972"
                    type="file_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2646">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/hosts.allow"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="hosts.allow"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806958"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806972"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

3.3.5 Ensure permissions on /etc/hosts.deny are configured

Description:

The /etc/hosts.deny file contains network information that is used by many system applications and therefore must be readable for these applications to operate.

It is critical to ensure that the /etc/hosts.deny file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions.

Run the following commands to set permissions on /etc/hosts.deny :

# chown root:root /etc/hosts.deny
# chmod 644 /etc/hosts.deny

Any of the following tests or sub-groups may pass:
Ensure no file named /etc/hosts.deny exists and unknown test -- Less
CIS-CAT did not expect to collect any file items, and found 1 item.
File: /etc/hosts.deny exists
Ensure at least one file named /etc/hosts.deny exists and is owned by 0:0 and has permissions rw-r--r-- and does not have permissions --x-wx-wx SUID SGID sticky -- More
File: /etc/hosts.deny
CIS-CAT Expected... CIS-CAT Collected...
the file's Owner Write to be set to true true
the file's Group Execute to be set to false false
the file's Owner Execute to be set to false false
the file's SUID to be set to false false
the file's Other Execute to be set to false false
the file's Owner Read to be set to true true
the file's Other Read to be set to true true
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Sticky Bit to be set to false false
the file's SGID to be set to false false
the file's Other Write to be set to false false
the file's Group Read to be set to true true
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.3.5_Ensure_permissions_on_etchosts.deny_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:35.813+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:35.814+07:00"
         start-time="2022-01-05T01:03:35.754+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure no file named /etc/hosts.deny exists and unknown test"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807005"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807005"
                    type="file_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2647">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/hosts.deny"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="hosts.deny"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/hosts.deny exists and is owned by 0:0 and has permissions rw-r--r-- and does not have permissions --x-wx-wx SUID SGID sticky"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806987"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806987"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806987">
       <cis:evidence_item itemref="2648">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/hosts.deny"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="hosts.deny"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="true" dt="boolean" ev="true" name="uwrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="uexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="suid" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="true" name="uread" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="true" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="sticky" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="sgid" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="true" name="gread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806987"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807005"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

3.4 Uncommon Network Protocols

The Linux kernel modules support several network protocols that are not commonly used. If these protocols are not needed, it is recommended that they be disabled in the kernel.

Note: This should not be considered a comprehensive list of uncommon network protocols, you may wish to consider additions to those listed here for your environment.

3.5 Firewall Configuration

A Host based firewall Provides defense against external and internal threats by refusing unauthorized connections, to stop intrusion and provide a strong method of access control policy.

this section is intended only to ensure the resulting firewall rules are in place, not how they are configured

3.5.1 Ensure Firewall software is installed

In order to configure Firewall protection for you system, a Firewall software package needs to be installed

Pass

3.5.1.1 Ensure a Firewall package is installed

Description:

A Firewall package should be selected. Most firewall configuration utilities operate as a front end to nftables or iptables.

A Firewall package is required for firewall management and configuration.

Run one of the following commands to install the Firewall package that follows local site policy:

To install UFW , run the following command:

# apt install ufw

To install nftables , run the following command:

# apt install nftables

To install iptables , run the following command:

# apt install iptables

Any of the following tests or sub-groups may pass:
Ensure package name equals 'iptables' is installed -- More
CIS-CAT expected to collect at least 1 matching dpkg Package, and found 1 item.
Package Name: iptables exists
Any of the following tests or sub-groups may pass:
Ensure package name equals 'nftables' is installed -- Less
CIS-CAT expected to collect at least 1 matching dpkg Package, and found 0 items.
Package Name: nftables does not exist
Ensure package name equals 'ufw' is installed -- More
CIS-CAT expected to collect at least 1 matching dpkg Package, and found 1 item.
Package Name: ufw exists

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.1.1_Ensure_a_Firewall_package_is_installed"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:35.906+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:35.907+07:00"
         start-time="2022-01-05T01:03:35.819+07:00">
<cis:or>
 <cis:or>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure package name equals 'nftables' is installed"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806977"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806977"
                       type="dpkginfo_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2649">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="name" value="nftables"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure package name equals 'ufw' is installed"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806968"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806968"
                       type="dpkginfo_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2650">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="name" value="ufw"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure package name equals 'iptables' is installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806981"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806981"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2651">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="iptables"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806968"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806977"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806981"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

3.5.2 Configure UncomplicatedFirewall

UncomplicatedFirewall (ufw) is a frontend for iptables. ufw provides a framework for managing netfilter, as well as a command-line interface for manipulating the firewall.

Pass

3.5.2.1 Ensure ufw service is enabled

Description:

UncomplicatedFirewall (ufw) is a frontend for iptables. ufw provides a framework for managing netfilter, as well as a command-line and available graphical user interface for manipulating the firewall.

Ensure that the ufw service is enabled to protect your system.

The ufw service must be enabled and running in order for ufw to protect the system

Run the following command to enable ufw:

# ufw enable

Impact:

Changing firewall settings while connected over network can result in being locked out of the system.

Any of the following tests or sub-groups may pass:
Ensure standard service 'ufw' is enabled -- More
Check: All Must Pass
Unit: ufw
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to be set to enabled enabled
Ensure package name equals 'ufw' is not installed -- Less
CIS-CAT did not expect to collect any matching dpkg Packages, and found 1 item.
Package Name: ufw exists

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.2.1_Ensure_ufw_service_is_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:35.950+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">http://manpages.ubuntu.com/manpages/precise/en/man8/ufw.8.html</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:35.951+07:00"
         start-time="2022-01-05T01:03:35.911+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure standard service 'ufw' is enabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806993"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806993"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806993">
       <cis:evidence_item itemref="2652">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="ufw"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="enabled" dt="string" ev="enabled" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'ufw' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806996"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806996"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2653">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="ufw"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806993"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806996"/>
</check>
</complex-check>
</rule-result>

References:

Unknown

3.5.2.2 Ensure default deny firewall policy

Description:

A default deny policy on connections ensures that any unconfigured network usage will be rejected.

With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage.

Run the following commands to implement a default deny policy:

# ufw default deny incoming # ufw default deny outgoing # ufw default deny routed

Any of the following tests or sub-groups may pass:
Ensure package name equals 'ufw' is not installed -- Less
CIS-CAT did not expect to collect any matching dpkg Packages, and found 1 item.
Package Name: ufw exists
All of the following tests or sub-groups must pass:
Ensure default deny firewall policy -- More
Script: sce/ufw_status.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
All of the following tests or sub-groups must pass:
Ensure default deny firewall policy -- More
Script: sce/ufw_status.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure default deny firewall policy -- More
Script: sce/ufw_status.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.2.2_Ensure_default_deny_firewall_policy"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:36.029+07:00"
  version="1"
  weight="1.0">
<result>unknown</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:36.029+07:00"
         start-time="2022-01-05T01:03:35.969+07:00">
<cis:or>
 <cis:and>
    <cis:and>
       <cis:evidence_test comment="Ensure default deny firewall policy" result="unknown">
          <cis:evidence_sce exit-code="-1" full-path="" href="sce/ufw_status.sh">
             <cis:environment_variables>
                <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
             </cis:environment_variables>
          </cis:evidence_sce>
       </cis:evidence_test>
       <cis:evidence_test comment="Ensure default deny firewall policy" result="unknown">
          <cis:evidence_sce exit-code="-1" full-path="" href="sce/ufw_status.sh">
             <cis:environment_variables>
                <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
             </cis:environment_variables>
          </cis:evidence_sce>
       </cis:evidence_test>
    </cis:and>
    <cis:evidence_test comment="Ensure default deny firewall policy" result="unknown">
       <cis:evidence_sce exit-code="-1" full-path="" href="sce/ufw_status.sh">
          <cis:environment_variables>
             <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
             <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
             <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
             <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
             <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
             <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
          </cis:environment_variables>
       </cis:evidence_sce>
    </cis:evidence_test>
 </cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'ufw' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807020"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807020"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2654">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="ufw"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="AND">
<xccdf:complex-check operator="AND">
 <check system="http://open-scap.org/page/SCE">
    <check-import import-name="stdout"/>
    <check-export export-name="XCCDF_VALUE_REGEX"
                  value-id="xccdf_org.cisecurity.benchmarks_value_807006_var"/>
    <check-content-ref href="sce/ufw_status.sh"/>
 </check>
 <check system="http://open-scap.org/page/SCE">
    <check-import import-name="stdout"/>
    <check-export export-name="XCCDF_VALUE_REGEX"
                  value-id="xccdf_org.cisecurity.benchmarks_value_807011_var"/>
    <check-content-ref href="sce/ufw_status.sh"/>
 </check>
</xccdf:complex-check>
<check system="http://open-scap.org/page/SCE">
 <check-import import-name="stdout"/>
 <check-export export-name="XCCDF_VALUE_REGEX"
               value-id="xccdf_org.cisecurity.benchmarks_value_807015_var"/>
 <check-content-ref href="sce/ufw_status.sh"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807020"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Unknown

3.5.2.3 Ensure loopback traffic is configured

Description:

Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8 for IPv4 and ::1/128 for IPv6).

Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8 for IPv4 and ::1/128 for IPv6) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure.

Run the following commands to implement the loopback rules:

# ufw allow in on lo # ufw deny in from 127.0.0.0/8 # ufw deny in from ::1

All of the following tests or sub-groups must pass:
Ensure loopback traffic is configured -- More
Script: sce/ufw_status.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Any of the following tests or sub-groups may pass:
Ensure package name equals 'ufw' is not installed -- Less
CIS-CAT did not expect to collect any matching dpkg Packages, and found 1 item.
Package Name: ufw exists
Any of the following tests or sub-groups may pass:
Ensure loopback traffic is configured -- More
Script: sce/ufw_status.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure /boot/grub//grub.cfg contents Pattern Match ipv6\.disable=1 (string) -- Less
File: /boot/grub/grub.cfg
Pattern: ^[^#]\s*linux.*$
Match Text: linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro quiet splash $vt_handoff
CIS-CAT Expected... CIS-CAT Collected...
the collected item's text matches the regular expression ipv6\.disable=1 linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro quiet splash $vt_handoff

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.2.3_Ensure_loopback_traffic_is_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:36.122+07:00"
  version="1"
  weight="1.0">
<result>unknown</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:36.122+07:00"
         start-time="2022-01-05T01:03:36.072+07:00">
<cis:and>
 <cis:or>
    <cis:or>
       <cis:evidence_test comment="Ensure loopback traffic is configured" result="unknown">
          <cis:evidence_sce exit-code="-1" full-path="" href="sce/ufw_status.sh">
             <cis:environment_variables>
                <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
             </cis:environment_variables>
          </cis:evidence_sce>
       </cis:evidence_test>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure /boot/grub//grub.cfg contents Pattern Match ipv6\.disable=1 (string)"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807038"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807038"
                          type="textfilecontent54_test">
          <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807038">
             <cis:evidence_item itemref="2655">
                <cis:evidence_item_pk status="exists">
                   <cis:evidence_item_pk_field name="filepath" value="/boot/grub/grub.cfg"/>
                   <cis:evidence_item_pk_field name="path" value="/boot/grub"/>
                   <cis:evidence_item_pk_field name="filename" value="grub.cfg"/>
                   <cis:evidence_item_pk_field name="pattern" value="^[^#]\s*linux.*$"/>
                   <cis:evidence_item_pk_field name="instance" value="1"/>
                   <cis:evidence_item_pk_field name="text"
                                               value="        linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro  quiet splash $vt_handoff"/>
                </cis:evidence_item_pk>
                <cis:evidence_field cv="        linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro  quiet splash $vt_handoff"
                                    dt="string"
                                    ev="ipv6\.disable=1"
                                    name="text"
                                    op="pattern match"
                                    result="false"/>
             </cis:evidence_item>
          </cis:evidence_state>
       </cis:evidence_test>
    </cis:or>
    <cis:evidence_test check="all" check_existence="none_exist"
                       comment="Ensure package name equals 'ufw' is not installed"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807042"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807042"
                       type="dpkginfo_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2656">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="name" value="ufw"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test comment="Ensure loopback traffic is configured" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/ufw_status.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_807026_var"/>
<check-content-ref href="sce/ufw_status.sh"/>
</check>
<xccdf:complex-check operator="OR">
<xccdf:complex-check operator="OR">
 <check system="http://open-scap.org/page/SCE">
    <check-import import-name="stdout"/>
    <check-export export-name="XCCDF_VALUE_REGEX"
                  value-id="xccdf_org.cisecurity.benchmarks_value_807031_var"/>
    <check-content-ref href="sce/ufw_status.sh"/>
 </check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807038"
                  value-id="xccdf_org.cisecurity.benchmarks_value_8070381_var"/>
    <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:8070382"
                  value-id="xccdf_org.cisecurity.benchmarks_value_8070382_var"/>
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807038"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807042"/>
</check>
</xccdf:complex-check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Informational

3.5.2.5 Ensure firewall rules exist for all open ports

Description:

Any ports that have been opened on non-loopback addresses need firewall rules to govern traffic.

Without a firewall rule configured for open ports default firewall policy will drop all packets to these ports.

For each port identified in the audit which does not have a firewall rule establish a proper rule for accepting inbound connections:

# ufw allow in <port>/<tcp or udp protocol>

Any of the following tests or sub-groups may pass:
Ensure firewall rules exist for all open ports -- Less
Script: sce/ufw_open_ports.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'ufw' is not installed -- Less
CIS-CAT did not expect to collect any matching dpkg Packages, and found 1 item.
Package Name: ufw exists

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.2.5_Ensure_firewall_rules_exist_for_all_open_ports"
  role="unscored"
  severity="unknown"
  time="2022-01-05T01:03:36.232+07:00"
  version="1"
  weight="0.0">
<result>informational</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:36.233+07:00"
         start-time="2022-01-05T01:03:36.177+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure firewall rules exist for all open ports" result="informational">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/ufw_open_ports.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'ufw' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807062"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807062"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2657">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="ufw"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-content-ref href="sce/ufw_open_ports.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807062"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

3.5.3 Configure nftables

nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames and is the successor to iptables. The biggest change with the successor nftables is its simplicity. With iptables, we have to configure every single rule and use the syntax which can be compared with normal commands. With nftables, the simpler syntax, much like BPF (Berkely Packet Filter) means shorter lines and less repetition. Support for nftables should also be compiled into the kernel, together with the related nftables modules. Please ensure that your kernel supports nf_tables before choosing this option.

Note: This section broadly assumes starting with an empty nftables firewall ruleset (established by flushing the rules with nft flush ruleset). Remediation steps included onlyaffect the live system, you will also need to configure your default firewall configuration to apply on boot. Configuration of a live systems firewall directly over a remote connection will often result in being locked out. It is advised to have a known good firewall configuration set to run on boot and to configure an entire firewall structure in a script that is then run and tested before saving to boot.

The following will implement the firewall rules of this section and open ICMP, IGMP, and port 22(ssh) from anywhere. Opening the ports for ICMP, IGMP, and port 22(ssh) needs to be updated in accordence with local site policy. Allow port 22(ssh) needs to be updated to only allow systems requiring ssh connectivity to connect, as per site policy.

Save the script bellow as /etc/nftables/nftables.rules

#!/sbin/nft -f

# This nftables.rules config should be saved as /etc/nftables/nftables.rules

# flush nftables rulesset
flush ruleset

# Load nftables ruleset

# nftables config with inet table named filter

table inet filter {
# Base chain for input hook named input (Filters inbound network packets)
chain input {
type filter hook input priority 0; policy drop;

# Ensure loopback traffic is configured
iif "lo" accept
ip saddr 127.0.0.0/8 counter packets 0 bytes 0 drop
ip6 saddr ::1 counter packets 0 bytes 0 drop

# Ensure established connections are configured
ip protocol tcp ct state established accept
ip protocol udp ct state established accept
ip protocol icmp ct state established accept

# Accept port 22(SSH) traffic from anywhere
tcp dport ssh accept

# Accept ICMP and IGMP from anywhere
icmpv6 type { destination-unreachable, packet-too-big, time-exceeded, parameter-problem, mld-listener-query, mld-listener-report, mld-listener-done, nd-
router-solicit, nd-router-advert, nd-neighbor-solicit, nd-neighbor-advert, ind-neighbor-solicit, ind-neighbor-advert, mld2-listener-report } accept
icmp type { destination-unreachable, router-advertisement, router-solicitation, time-exceeded, parameter-problem } accept
ip protocol igmp accept
}

# Base chain for hook forward named forward (Filters forwarded network packets)
chain forward {
type filter hook forward priority 0; policy drop;
}

# Base chain for hook output named output (Filters outbount network packets)
chain output {
type filter hook output priority 0; policy drop;
# Ensure outbound and established connections are configured
ip protocol tcp ct state established,related,new accept
ip protocol udp ct state established,related,new accept
ip protocol icmp ct state established,related,new accept
}
}

Run the following command to load the file into nftables

# nft -f /etc/nftables/nftables.rules

All changes in the nftables subsections are temporary.

To make these changes permanent:

Run the following command to create the nftables.rules file

nft list ruleset > /etc/nftables/nftables.rules

Add the following line to /etc/sysconfig/nftables.conf

include "/etc/nftables/nftables.rules"
Pass

3.5.3.2 Ensure a table exists

Description:

Tables hold chains. Each table only has one address family and only applies to packets of this family. Tables can have one of five families.

nftables doesn't have any default tables. Without a table being build, nftables will not filter network traffic.

Run the following command to create a table in nftables

# nft create table inet <table name>

Example:

# nft create table inet filter

Impact:

Adding rules to a running nftables can cause loss of connectivity to the system

Any of the following tests or sub-groups may pass:
Ensure package name equals 'nftables' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: nftables does not exist
Any of the following tests or sub-groups may pass:
Ensure a table exists -- More
Script: sce/nft_tables.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure standard service 'nftables' is disabled -- More
Check: All Must Pass
Unit: nftables
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.3.2_Ensure_a_table_exists"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:36.336+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:36.337+07:00"
         start-time="2022-01-05T01:03:36.291+07:00">
<cis:or>
 <cis:or>
    <cis:evidence_test comment="Ensure a table exists" result="unknown">
       <cis:evidence_sce exit-code="-1" full-path="" href="sce/nft_tables.sh">
          <cis:environment_variables>
             <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
             <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
             <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
             <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
             <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
             <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
          </cis:environment_variables>
       </cis:evidence_sce>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="any_exist"
                       comment="Ensure standard service 'nftables' is disabled"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807076"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807076"
                       type="systemdunitproperty_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807076">
          <cis:evidence_item itemref="2658">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="unit" value="nftables"/>
                <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'nftables' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807083"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807083"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2659">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="nftables"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
 <check-import import-name="stdout"/>
 <check-export export-name="XCCDF_VALUE_REGEX"
               value-id="xccdf_org.cisecurity.benchmarks_value_807064_var"/>
 <check-content-ref href="sce/nft_tables.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807076"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807083"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

3.5.3.3 Ensure base chains exist

Description:

Chains are containers for rules. They exist in two kinds, base chains and regular chains. A base chain is an entry point for packets from the networking stack, a regular chain may be used as jump target and is used for better rule organization.

If a base chain doesn't exist with a hook for input, forward, and delete, packets that would flow through those chains will not be touched by nftables.

Run the following command to create the base chains:

# nft create chain inet <table name> <base chain name> { type filter hook <(input|forward|output)> priority 0 \; }

Example:

# nft create chain inet filter input { type filter hook input priority 0 \; }

# nft create chain inet filter forward { type filter hook forward priority 0 \; }

# nft create chain inet filter output { type filter hook output priority 0 \; }

Impact:

if configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity.

Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop

Any of the following tests or sub-groups may pass:
Ensure standard service 'nftablles' is disabled -- More
Check: All Must Pass
Unit: nftablles
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled
Any of the following tests or sub-groups may pass:
Ensure package name equals 'nftablles' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: nftablles does not exist
All of the following tests or sub-groups must pass:
Ensure base chains exist -- More
Script: sce/nft_ruleset.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
All of the following tests or sub-groups must pass:
Ensure base chains exist -- More
Script: sce/nft_ruleset.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure base chains exist -- More
Script: sce/nft_ruleset.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.3.3_Ensure_base_chains_exist"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:36.472+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:36.472+07:00"
         start-time="2022-01-05T01:03:36.410+07:00">
<cis:or>
 <cis:or>
    <cis:and>
       <cis:and>
          <cis:evidence_test comment="Ensure base chains exist" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/nft_ruleset.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
          <cis:evidence_test comment="Ensure base chains exist" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/nft_ruleset.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
       </cis:and>
       <cis:evidence_test comment="Ensure base chains exist" result="unknown">
          <cis:evidence_sce exit-code="-1" full-path="" href="sce/nft_ruleset.sh">
             <cis:environment_variables>
                <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
             </cis:environment_variables>
          </cis:evidence_sce>
       </cis:evidence_test>
    </cis:and>
    <cis:evidence_test check="all" check_existence="none_exist"
                       comment="Ensure package name equals 'nftablles' is not installed"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807119"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807119"
                       type="dpkginfo_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2660">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="name" value="nftablles"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'nftablles' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807122"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807122"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807122">
       <cis:evidence_item itemref="2661">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="nftablles"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<xccdf:complex-check operator="AND">
 <xccdf:complex-check operator="AND">
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807099_var"/>
       <check-content-ref href="sce/nft_ruleset.sh"/>
    </check>
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807108_var"/>
       <check-content-ref href="sce/nft_ruleset.sh"/>
    </check>
 </xccdf:complex-check>
 <check system="http://open-scap.org/page/SCE">
    <check-import import-name="stdout"/>
    <check-export export-name="XCCDF_VALUE_REGEX"
                  value-id="xccdf_org.cisecurity.benchmarks_value_807116_var"/>
    <check-content-ref href="sce/nft_ruleset.sh"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807119"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807122"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

3.5.3.4 Ensure loopback traffic is configured

Description:

Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network

Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure.

Run the following commands to implement the loopback rules:

# nft add rule inet filter input iif lo accept # nft create rule inet filter input ip saddr 127.0.0.0/8 counter drop # nft add rule inet filter input ip6 saddr ::1 counter drop

Any of the following tests or sub-groups may pass:
Ensure standard service 'nftables' is disabled -- More
Check: All Must Pass
Unit: nftables
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled
All of the following tests or sub-groups must pass:
Ensure package name equals 'nftables' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: nftables does not exist
All of the following tests or sub-groups must pass:
Ensure loopback traffic is configured -- More
Script: sce/nft_ruleset_basechain.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure loopback traffic is configured -- More
Script: sce/nft_ruleset_basechain.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Any of the following tests or sub-groups may pass:
Ensure loopback traffic is configured -- More
Script: sce/nft_ruleset_basechain.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure /boot/grub//grub.cfg contents Pattern Match ipv6\.disable=1 (string) -- Less
File: /boot/grub/grub.cfg
Pattern: ^[^#]\s*linux.*$
Match Text: linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro quiet splash $vt_handoff
CIS-CAT Expected... CIS-CAT Collected...
the collected item's text matches the regular expression ipv6\.disable=1 linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro quiet splash $vt_handoff

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.3.4_Ensure_loopback_traffic_is_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:36.562+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:36.562+07:00"
         start-time="2022-01-05T01:03:36.489+07:00">
<cis:or>
 <cis:or>
    <cis:and>
       <cis:and>
          <cis:evidence_test comment="Ensure loopback traffic is configured" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/nft_ruleset_basechain.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
          <cis:evidence_test comment="Ensure loopback traffic is configured" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/nft_ruleset_basechain.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
       </cis:and>
       <cis:or>
          <cis:evidence_test comment="Ensure loopback traffic is configured" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/nft_ruleset_basechain.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure /boot/grub//grub.cfg contents Pattern Match ipv6\.disable=1 (string)"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807132"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807132"
                             type="textfilecontent54_test">
             <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807132">
                <cis:evidence_item itemref="2662">
                   <cis:evidence_item_pk status="exists">
                      <cis:evidence_item_pk_field name="filepath" value="/boot/grub/grub.cfg"/>
                      <cis:evidence_item_pk_field name="path" value="/boot/grub"/>
                      <cis:evidence_item_pk_field name="filename" value="grub.cfg"/>
                      <cis:evidence_item_pk_field name="pattern" value="^[^#]\s*linux.*$"/>
                      <cis:evidence_item_pk_field name="instance" value="1"/>
                      <cis:evidence_item_pk_field name="text"
                                                  value="        linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro  quiet splash $vt_handoff"/>
                   </cis:evidence_item_pk>
                   <cis:evidence_field cv="        linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro  quiet splash $vt_handoff"
                                       dt="string"
                                       ev="ipv6\.disable=1"
                                       name="text"
                                       op="pattern match"
                                       result="false"/>
                </cis:evidence_item>
             </cis:evidence_state>
          </cis:evidence_test>
       </cis:or>
       <cis:evidence_test check="all" check_existence="none_exist"
                          comment="Ensure package name equals 'nftables' is not installed"
                          negated="false"
                          ns="linux"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807134"
                          result="true"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807134"
                          type="dpkginfo_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2663">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="name" value="nftables"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:and>
    <cis:evidence_test check="all" check_existence="any_exist"
                       comment="Ensure standard service 'nftables' is disabled"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807136"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807136"
                       type="systemdunitproperty_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807136">
          <cis:evidence_item itemref="2664">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="unit" value="nftables"/>
                <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
 </cis:or>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<xccdf:complex-check operator="AND">
 <xccdf:complex-check operator="AND">
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807125_var"/>
       <check-content-ref href="sce/nft_ruleset_basechain.sh"/>
    </check>
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807128_var"/>
       <check-content-ref href="sce/nft_ruleset_basechain.sh"/>
    </check>
 </xccdf:complex-check>
 <xccdf:complex-check operator="OR">
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807130_var"/>
       <check-content-ref href="sce/nft_ruleset_basechain.sh"/>
    </check>
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807132"
                     value-id="xccdf_org.cisecurity.benchmarks_value_8071321_var"/>
       <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:8071322"
                     value-id="xccdf_org.cisecurity.benchmarks_value_8071322_var"/>
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807132"/>
    </check>
 </xccdf:complex-check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807134"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807136"/>
</check>
</xccdf:complex-check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

3.5.3.6 Ensure default deny firewall policy

Description:

Base chain policy is the default verdict that will be applied to packets reaching the end of the chain.

There are two policies: accept (Default) and drop. If the policy is set to accept , the firewall will accept any packet that is not configured to be denied and the packet will continue transversing the network stack.

It is easier to white list acceptable usage than to black list unacceptable usage.

Run the following command for the base chains with the input, forward, and output hooks to implement a default DROP policy:

# nft chain <table family> <table name> <chain name> { policy drop \; }

Example:

# nft chain inet filter input { policy drop \; }

# nft chain inet filter forward { policy drop \; }

# nft chain inet filter output { policy drop \; }

Impact:

if configuring nftables over ssh, creating a base chain with a policy of drop will cause loss of connectivity.

Ensure that a rule allowing ssh has been added to the base chain prior to setting the base chain's policy to drop

Any of the following tests or sub-groups may pass:
Ensure standard service 'nftables' is disabled -- More
Check: All Must Pass
Unit: nftables
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled
Any of the following tests or sub-groups may pass:
Ensure package name equals 'nftables' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: nftables does not exist
All of the following tests or sub-groups must pass:
Ensure default deny firewall policy -- More
Script: sce/nft_ruleset_drop.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
All of the following tests or sub-groups must pass:
Ensure default deny firewall policy -- More
Script: sce/nft_ruleset_drop.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure default deny firewall policy -- More
Script: sce/nft_ruleset_drop.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.3.6_Ensure_default_deny_firewall_policy"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:36.676+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">Manual Page nft</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:36.677+07:00"
         start-time="2022-01-05T01:03:36.621+07:00">
<cis:or>
 <cis:or>
    <cis:and>
       <cis:and>
          <cis:evidence_test comment="Ensure default deny firewall policy" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/nft_ruleset_drop.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
          <cis:evidence_test comment="Ensure default deny firewall policy" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/nft_ruleset_drop.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
       </cis:and>
       <cis:evidence_test comment="Ensure default deny firewall policy" result="unknown">
          <cis:evidence_sce exit-code="-1" full-path="" href="sce/nft_ruleset_drop.sh">
             <cis:environment_variables>
                <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
             </cis:environment_variables>
          </cis:evidence_sce>
       </cis:evidence_test>
    </cis:and>
    <cis:evidence_test check="all" check_existence="none_exist"
                       comment="Ensure package name equals 'nftables' is not installed"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807037"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807037"
                       type="dpkginfo_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2665">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="name" value="nftables"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure standard service 'nftables' is disabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807048"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807048"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807048">
       <cis:evidence_item itemref="2666">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="nftables"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<xccdf:complex-check operator="AND">
 <xccdf:complex-check operator="AND">
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807003_var"/>
       <check-content-ref href="sce/nft_ruleset_drop.sh"/>
    </check>
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807014_var"/>
       <check-content-ref href="sce/nft_ruleset_drop.sh"/>
    </check>
 </xccdf:complex-check>
 <check system="http://open-scap.org/page/SCE">
    <check-import import-name="stdout"/>
    <check-export export-name="XCCDF_VALUE_REGEX"
                  value-id="xccdf_org.cisecurity.benchmarks_value_807024_var"/>
    <check-content-ref href="sce/nft_ruleset_drop.sh"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807037"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807048"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:
  • CCE-IDv5: Manual Page nft -- More
    CCE Information
    CCE-IDv5: Manual Page nft
    Published On:
    Last Modified On:

Pass

3.5.3.7 Ensure nftables service is enabled

Description:

The nftables service allows for the loading of nftables rulesets during boot, or starting on the nftables service

The nftables service restores the nftables rules from the rules files referenced in the /etc/sysconfig/nftables.conf file durring boot or the starting of the nftables service

Run the following command to enable the nftables service:

# systemctl enable nftables

Any of the following tests or sub-groups may pass:
Ensure package name equals 'nftables' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: nftables does not exist
Ensure standard service 'nftables' is enabled -- Less
Check: All Must Pass
Unit: nftables
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to be set to enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.3.7_Ensure_nftables_service_is_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:36.804+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:36.804+07:00"
         start-time="2022-01-05T01:03:36.721+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'nftables' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807140"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807140"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2667">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="nftables"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure standard service 'nftables' is enabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807139"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807139"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807139">
       <cis:evidence_item itemref="2668">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="nftables"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="equals" result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807139"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807140"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

3.5.3.8 Ensure nftables rules are permanent

Description:

nftables is a subsystem of the Linux kernel providing filtering and classification of network packets/datagrams/frames.

The nftables service reads the /etc/sysconfig/nftables.conf file for a nftables file or files to include in the nftables ruleset.

A nftables ruleset containing the input, forward, and output base chains allow network traffic to be filtered.

Changes made to nftables ruleset only affect the live system, you will also need to configure the nftables ruleset to apply on boot

Edit the /etc/sysconfig/nftables.conf file and un-comment or add a line with include <Absolute path to nftables rules file> for each nftables file you want included in the nftables ruleset on boot

example:

# vi /etc/sysconfig/nftables.conf

Add the line:

include "/etc/nftables/nftables.rules"

Any of the following tests or sub-groups may pass:
Ensure at least one file named /etc/sysconfig/nftables.conf exists and matches pattern ^\s*include -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/sysconfig/nftables.conf does not exist
Pattern: ^\s*include
Match Text: No match found
Ensure package name equals 'nftables' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: nftables does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.3.8_Ensure_nftables_rules_are_permanent"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:36.891+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:36.891+07:00"
         start-time="2022-01-05T01:03:36.856+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/sysconfig/nftables.conf exists and matches pattern ^\s*include"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807142"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807142"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2669">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/sysconfig/nftables.conf"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*include"/>
             <cis:evidence_item_pk_field name="instance" value="1"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'nftables' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807144"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807144"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2670">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="nftables"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807142"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807144"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

3.5.4 Configure iptables

IPtables is an application that allows a system administrator to configure the IPv4 and IPv6 tables, chains and rules provided by the Linux kernel firewall. While several methods of configuration exist this section is intended only to ensure the resulting IPtables rules are in place, not how they are configured. If IPv6 is in use in your environment, similar settings should be applied to the IP6tables as well.

3.5.4.1 Configure IPv4 iptables

Iptables is used to set up, maintain, and inspect the tables of IP packet filter rules in the Linux kernel. Several different tables may be defined. Each table contains a number of built-in chains and may also contain user-defined chains.

Each chain is a list of rules which can match a set of packets. Each rule specifies what to do with a packet that matches. This is called a 'target', which may be a jump to a user-defined chain in the same table.

Note: This section broadly assumes starting with an empty IPtables firewall ruleset (established by flushing the rules with iptables -F). Remediation steps included only affect the live system, you will also need to configure your default firewall configuration to apply on boot. Configuration of a live systems firewall directly over a remote connection will often result in being locked out. It is advised to have a known good firewall configuration set to run on boot and to configure an entire firewall structure in a script that is then run and tested before saving to boot. The following script will implement the firewall rules of this section and open port 22(ssh) from anywhere:

#!/bin/bash

# Flush IPtables rules
iptables -F

# Ensure default deny firewall policy
iptables -P INPUT DROP
iptables -P OUTPUT DROP
iptables -P FORWARD DROP

# Ensure loopback traffic is configured
iptables -A INPUT -i lo -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A INPUT -s 127.0.0.0/8 -j DROP

# Ensure outbound and established connections are configured
iptables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -p icmp -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT
iptables -A INPUT -p icmp -m state --state ESTABLISHED -j ACCEPT

# Open inbound ssh(tcp port 22) connections
iptables -A INPUT -p tcp --dport 22 -m state --state NEW -j ACCEPT
Pass

3.5.4.1.1 Ensure default deny firewall policy

Description:

A default deny all policy on connections ensures that any unconfigured network usage will be rejected.

With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage.

Run the following commands to implement a default DROP policy:

# iptables -P INPUT DROP
# iptables -P OUTPUT DROP
# iptables -P FORWARD DROP

Any of the following tests or sub-groups may pass:
Ensure package name equals 'iptables' is not installed -- Less
CIS-CAT did not expect to collect any matching dpkg Packages, and found 1 item.
Package Name: iptables exists
Any of the following tests or sub-groups may pass:
Ensure standard service 'iptables' is disabled -- More
Check: All Must Pass
Unit: iptables
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled
All of the following tests or sub-groups must pass:
Ensure default deny firewall policy -- More
Script: sce/iptables_chk.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
All of the following tests or sub-groups must pass:
Ensure default deny firewall policy -- More
Script: sce/iptables_chk.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure default deny firewall policy -- More
Script: sce/iptables_chk.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.4.1.1_Ensure_default_deny_firewall_policy"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:36.978+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:36.979+07:00"
         start-time="2022-01-05T01:03:36.914+07:00">
<cis:or>
 <cis:or>
    <cis:and>
       <cis:and>
          <cis:evidence_test comment="Ensure default deny firewall policy" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/iptables_chk.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
          <cis:evidence_test comment="Ensure default deny firewall policy" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/iptables_chk.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
       </cis:and>
       <cis:evidence_test comment="Ensure default deny firewall policy" result="unknown">
          <cis:evidence_sce exit-code="-1" full-path="" href="sce/iptables_chk.sh">
             <cis:environment_variables>
                <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
             </cis:environment_variables>
          </cis:evidence_sce>
       </cis:evidence_test>
    </cis:and>
    <cis:evidence_test check="all" check_existence="any_exist"
                       comment="Ensure standard service 'iptables' is disabled"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807041"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807041"
                       type="systemdunitproperty_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807041">
          <cis:evidence_item itemref="2671">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="unit" value="iptables"/>
                <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'iptables' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807047"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807047"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2672">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="iptables"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<xccdf:complex-check operator="AND">
 <xccdf:complex-check operator="AND">
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807028_var"/>
       <check-content-ref href="sce/iptables_chk.sh"/>
    </check>
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807032_var"/>
       <check-content-ref href="sce/iptables_chk.sh"/>
    </check>
 </xccdf:complex-check>
 <check system="http://open-scap.org/page/SCE">
    <check-import import-name="stdout"/>
    <check-export export-name="XCCDF_VALUE_REGEX"
                  value-id="xccdf_org.cisecurity.benchmarks_value_807039_var"/>
    <check-content-ref href="sce/iptables_chk.sh"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807041"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807047"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

3.5.4.1.2 Ensure loopback traffic is configured

Description:

Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (127.0.0.0/8).

Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (127.0.0.0/8) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure.

Run the following commands to implement the loopback rules:

# iptables -A INPUT -i lo -j ACCEPT
# iptables -A OUTPUT -o lo -j ACCEPT
# iptables -A INPUT -s 127.0.0.0/8 -j DROP

Any of the following tests or sub-groups may pass:
Ensure package name equals 'iptables' is not installed -- Less
CIS-CAT did not expect to collect any matching dpkg Packages, and found 1 item.
Package Name: iptables exists
Any of the following tests or sub-groups may pass:
Ensure standard service 'iptables' is disabled -- More
Check: All Must Pass
Unit: iptables
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled
All of the following tests or sub-groups must pass:
Ensure loopback traffic is configured -- More
Script: sce/iptables_output.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
All of the following tests or sub-groups must pass:
Ensure loopback traffic is configured -- More
Script: sce/iptables_input.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure loopback traffic is configured -- More
Script: sce/iptables_input.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.4.1.2_Ensure_loopback_traffic_is_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:37.091+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:37.091+07:00"
         start-time="2022-01-05T01:03:37.016+07:00">
<cis:or>
 <cis:or>
    <cis:and>
       <cis:and>
          <cis:evidence_test comment="Ensure loopback traffic is configured" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/iptables_input.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
          <cis:evidence_test comment="Ensure loopback traffic is configured" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/iptables_input.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
       </cis:and>
       <cis:evidence_test comment="Ensure loopback traffic is configured" result="unknown">
          <cis:evidence_sce exit-code="-1" full-path="" href="sce/iptables_output.sh">
             <cis:environment_variables>
                <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
             </cis:environment_variables>
          </cis:evidence_sce>
       </cis:evidence_test>
    </cis:and>
    <cis:evidence_test check="all" check_existence="any_exist"
                       comment="Ensure standard service 'iptables' is disabled"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807070"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807070"
                       type="systemdunitproperty_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807070">
          <cis:evidence_item itemref="2673">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="unit" value="iptables"/>
                <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'iptables' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807073"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807073"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2674">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="iptables"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<xccdf:complex-check operator="AND">
 <xccdf:complex-check operator="AND">
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807055_var"/>
       <check-content-ref href="sce/iptables_input.sh"/>
    </check>
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807061_var"/>
       <check-content-ref href="sce/iptables_input.sh"/>
    </check>
 </xccdf:complex-check>
 <check system="http://open-scap.org/page/SCE">
    <check-import import-name="stdout"/>
    <check-export export-name="XCCDF_VALUE_REGEX"
                  value-id="xccdf_org.cisecurity.benchmarks_value_807066_var"/>
    <check-content-ref href="sce/iptables_output.sh"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807070"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807073"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

3.5.4.1.4 Ensure firewall rules exist for all open ports

Description:

Any ports that have been opened on non-loopback addresses need firewall rules to govern traffic.

Without a firewall rule configured for open ports default firewall policy will drop all packets to these ports.

For each port identified in the audit which does not have a firewall rule establish a proper rule for accepting inbound connections:

# iptables -A INPUT -p <protocol> --dport <port> -m state --state NEW -j ACCEPT

Any of the following tests or sub-groups may pass:
Ensure package name equals 'iptables' is not installed -- Less
CIS-CAT did not expect to collect any matching dpkg Packages, and found 1 item.
Package Name: iptables exists
Any of the following tests or sub-groups may pass:
Ensure standard service 'iptables' is disabled -- More
Check: All Must Pass
Unit: iptables
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled
Linux Custom Object "Firewall Rule Exists For All Open Ports" -- Less
Check: All Must Pass
Command: iptables -L INPUT -v -n
Line Selection: \s+dpt:0\s+state\s+NEW\s*$
CIS-CAT Expected (At least one of)... CIS-CAT Collected...
the Std. Output matches the regular expression .+
Linux Custom Object "Firewall Rule Exists For All Open Ports" -- More
CIS-CAT did not expect to collect any matching items, and found 0 items.
Protocol: .*, Local Address: ^(?!127\.0\.0\.1|::1).*$, Local Port: 0 does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.4.1.4_Ensure_firewall_rules_exist_for_all_open_ports"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:37.236+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:37.237+07:00"
         start-time="2022-01-05T01:03:37.124+07:00">
<cis:or>
 <cis:or>
    <cis:evidence_test check="all" check_existence="any_exist"
                       comment="Ensure standard service 'iptables' is disabled"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807087"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807087"
                       type="systemdunitproperty_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807087">
          <cis:evidence_item itemref="2675">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="unit" value="iptables"/>
                <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Linux Custom Object &#34;Firewall Rule Exists For All Open Ports&#34;"
                       negated="false"
                       ns="cmd"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807084"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807084"
                       type="shellcommand_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807084">
          <cis:evidence_item entity_check="at least one" itemref="2678">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="command" value="iptables -L INPUT -v -n"/>
                <cis:evidence_item_pk_field name="line_selection" value="\s+dpt:0\s+state\s+NEW\s*$"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="" dt="string" ev=".+" name="stdout_line" op="pattern match" result="false"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="none_exist"
                       comment="Linux Custom Object &#34;Firewall Rule Exists For All Open Ports&#34;"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070842"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:8070842"
                       type="inetlisteningservers_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2677">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="protocol" value=".*"/>
                <cis:evidence_item_pk_field name="local_address" value="^(?!127\.0\.0\.1|::1).*$"/>
                <cis:evidence_item_pk_field name="local_port" value="0"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'iptables' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807091"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807091"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2679">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="iptables"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807084"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807087"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807091"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:
  • http://cisecurity.org/20-cc/v7.0:

3.5.4.2 Configure IPv6 ip6tables

Ip6tables is used to set up, maintain, and inspect the tables of IPv6 packet filter rules in the Linux kernel. Several different tables may be defined. Each table contains a number of built-in chains and may also contain user-defined chains. Each chain is a list of rules which can match a set of packets. Each rule specifies what to do with a packet that matches. This is called a `target', which may be a jump to a user-defined chain in the same table.

If IPv6 in enabled on the system, the ip6tables should be configured.

Note: This section broadly assumes starting with an empty ip6tables firewall ruleset (established by flushing the rules with ip6tables -F). Remediation steps included only affect the live system, you will also need to configure your default firewall configuration to apply on boot. Configuration of a live systems firewall directly over a remote connection will often result in being locked out. It is advised to have a known good firewall configuration set to run on boot and to configure an entire firewall structure in a script that is then run and tested before saving to boot. The following script will implement the firewall rules of this section and open port 22(ssh) from anywhere:

#!/bin/bash

# Flush ip6tables rules
ip6tables -F

# Ensure default deny firewall policy
ip6tables -P INPUT DROP
ip6tables -P OUTPUT DROP
ip6tables -P FORWARD DROP

# Ensure loopback traffic is configured
ip6tables -A INPUT -i lo -j ACCEPT
ip6tables -A OUTPUT -o lo -j ACCEPT
ip6tables -A INPUT -s ::1 -j DROP

# Ensure outbound and established connections are configured
ip6tables -A OUTPUT -p tcp -m state --state NEW,ESTABLISHED -j ACCEPT
ip6tables -A OUTPUT -p udp -m state --state NEW,ESTABLISHED -j ACCEPT
ip6tables -A OUTPUT -p icmp -m state --state NEW,ESTABLISHED -j ACCEPT
ip6tables -A INPUT -p tcp -m state --state ESTABLISHED -j ACCEPT
ip6tables -A INPUT -p udp -m state --state ESTABLISHED -j ACCEPT
ip6tables -A INPUT -p icmp -m state --state ESTABLISHED -j ACCEPT

# Open inbound ssh(tcp port 22) connections
ip6tables -A INPUT -p tcp --dport 22 -m state --state NEW -j ACCEPT
Pass

3.5.4.2.1 Ensure IPv6 default deny firewall policy

Description:

A default deny all policy on connections ensures that any unconfigured network usage will be rejected.

With a default accept policy the firewall will accept any packet that is not configured to be denied. It is easier to white list acceptable usage than to black list unacceptable usage.

Run the following commands to implement a default DROP policy:

# ip6tables -P INPUT DROP
# ip6tables -P OUTPUT DROP
# ip6tables -P FORWARD DROP

Any of the following tests or sub-groups may pass:
Ensure package name equals 'iptables' is not installed -- Less
CIS-CAT did not expect to collect any matching dpkg Packages, and found 1 item.
Package Name: iptables exists
Any of the following tests or sub-groups may pass:
Ensure standard service 'iptables' is disabled -- More
Check: All Must Pass
Unit: iptables
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled
Any of the following tests or sub-groups may pass:
Ensure /boot/grub/grub.cfg contents Pattern Match ipv6\.disable=1 (string) -- Less
File: /boot/grub/grub.cfg
Pattern: ^[^#]\s*linux.*$
Match Text: linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro quiet splash $vt_handoff
CIS-CAT Expected... CIS-CAT Collected...
the collected item's text matches the regular expression ipv6\.disable=1 linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro quiet splash $vt_handoff
All of the following tests or sub-groups must pass:
Ensure IPv6 default deny firewall policy -- More
Script: sce/ip6tables_chk.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
All of the following tests or sub-groups must pass:
Ensure IPv6 default deny firewall policy -- More
Script: sce/ip6tables_chk.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure IPv6 default deny firewall policy -- More
Script: sce/ip6tables_chk.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.4.2.1_Ensure_IPv6_default_deny_firewall_policy"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:37.393+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:37.394+07:00"
         start-time="2022-01-05T01:03:37.314+07:00">
<cis:or>
 <cis:or>
    <cis:or>
       <cis:and>
          <cis:and>
             <cis:evidence_test comment="Ensure IPv6 default deny firewall policy" result="unknown">
                <cis:evidence_sce exit-code="-1" full-path="" href="sce/ip6tables_chk.sh">
                   <cis:environment_variables>
                      <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                   </cis:environment_variables>
                </cis:evidence_sce>
             </cis:evidence_test>
             <cis:evidence_test comment="Ensure IPv6 default deny firewall policy" result="unknown">
                <cis:evidence_sce exit-code="-1" full-path="" href="sce/ip6tables_chk.sh">
                   <cis:environment_variables>
                      <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                   </cis:environment_variables>
                </cis:evidence_sce>
             </cis:evidence_test>
          </cis:and>
          <cis:evidence_test comment="Ensure IPv6 default deny firewall policy" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/ip6tables_chk.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
       </cis:and>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure /boot/grub/grub.cfg contents Pattern Match ipv6\.disable=1 (string)"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807071"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807071"
                          type="textfilecontent54_test">
          <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807071">
             <cis:evidence_item itemref="2680">
                <cis:evidence_item_pk status="exists">
                   <cis:evidence_item_pk_field name="filepath" value="/boot/grub/grub.cfg"/>
                   <cis:evidence_item_pk_field name="path" value="/boot/grub"/>
                   <cis:evidence_item_pk_field name="filename" value="grub.cfg"/>
                   <cis:evidence_item_pk_field name="pattern" value="^[^#]\s*linux.*$"/>
                   <cis:evidence_item_pk_field name="instance" value="1"/>
                   <cis:evidence_item_pk_field name="text"
                                               value="        linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro  quiet splash $vt_handoff"/>
                </cis:evidence_item_pk>
                <cis:evidence_field cv="        linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro  quiet splash $vt_handoff"
                                    dt="string"
                                    ev="ipv6\.disable=1"
                                    name="text"
                                    op="pattern match"
                                    result="false"/>
             </cis:evidence_item>
          </cis:evidence_state>
       </cis:evidence_test>
    </cis:or>
    <cis:evidence_test check="all" check_existence="any_exist"
                       comment="Ensure standard service 'iptables' is disabled"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807081"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807081"
                       type="systemdunitproperty_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807081">
          <cis:evidence_item itemref="2681">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="unit" value="iptables"/>
                <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'iptables' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807090"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807090"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2682">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="iptables"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<xccdf:complex-check operator="OR">
 <xccdf:complex-check operator="AND">
    <xccdf:complex-check operator="AND">
       <check system="http://open-scap.org/page/SCE">
          <check-import import-name="stdout"/>
          <check-export export-name="XCCDF_VALUE_REGEX"
                        value-id="xccdf_org.cisecurity.benchmarks_value_807045_var"/>
          <check-content-ref href="sce/ip6tables_chk.sh"/>
       </check>
       <check system="http://open-scap.org/page/SCE">
          <check-import import-name="stdout"/>
          <check-export export-name="XCCDF_VALUE_REGEX"
                        value-id="xccdf_org.cisecurity.benchmarks_value_807051_var"/>
          <check-content-ref href="sce/ip6tables_chk.sh"/>
       </check>
    </xccdf:complex-check>
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807059_var"/>
       <check-content-ref href="sce/ip6tables_chk.sh"/>
    </check>
 </xccdf:complex-check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807071"
                  value-id="xccdf_org.cisecurity.benchmarks_value_8070711_var"/>
    <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:8070712"
                  value-id="xccdf_org.cisecurity.benchmarks_value_8070712_var"/>
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807071"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807081"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807090"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

3.5.4.2.2 Ensure IPv6 loopback traffic is configured

Description:

Configure the loopback interface to accept traffic. Configure all other interfaces to deny traffic to the loopback network (::1).

Loopback traffic is generated between processes on machine and is typically critical to operation of the system. The loopback interface is the only place that loopback network (::1) traffic should be seen, all other interfaces should ignore traffic on this network as an anti-spoofing measure.

Run the following commands to implement the loopback rules:

# ip6tables -A INPUT -i lo -j ACCEPT
# ip6tables -A OUTPUT -o lo -j ACCEPT
# ip6tables -A INPUT -s ::1 -j DROP

Any of the following tests or sub-groups may pass:
Ensure package name equals 'iptables' is not installed -- Less
CIS-CAT did not expect to collect any matching dpkg Packages, and found 1 item.
Package Name: iptables exists
Any of the following tests or sub-groups may pass:
Ensure standard service 'iptables' is disabled -- More
Check: All Must Pass
Unit: iptables
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to not be set to enabled
Any of the following tests or sub-groups may pass:
Ensure /boot/grub/grub.cfg contents Pattern Match ipv6\.disable=1 (string) -- Less
File: /boot/grub/grub.cfg
Pattern: ^[^#]\s*linux.*$
Match Text: linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro quiet splash $vt_handoff
CIS-CAT Expected... CIS-CAT Collected...
the collected item's text matches the regular expression ipv6\.disable=1 linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro quiet splash $vt_handoff
All of the following tests or sub-groups must pass:
Ensure IPv6 loopback traffic is configured -- More
Script: sce/ip6tables_output.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
All of the following tests or sub-groups must pass:
Ensure IPv6 loopback traffic is configured -- More
Script: sce/ip6tables_input.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure IPv6 loopback traffic is configured -- More
Script: sce/ip6tables_input.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.5.4.2.2_Ensure_IPv6_loopback_traffic_is_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:37.472+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:37.473+07:00"
         start-time="2022-01-05T01:03:37.399+07:00">
<cis:or>
 <cis:or>
    <cis:or>
       <cis:and>
          <cis:and>
             <cis:evidence_test comment="Ensure IPv6 loopback traffic is configured" result="unknown">
                <cis:evidence_sce exit-code="-1" full-path="" href="sce/ip6tables_input.sh">
                   <cis:environment_variables>
                      <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                   </cis:environment_variables>
                </cis:evidence_sce>
             </cis:evidence_test>
             <cis:evidence_test comment="Ensure IPv6 loopback traffic is configured" result="unknown">
                <cis:evidence_sce exit-code="-1" full-path="" href="sce/ip6tables_input.sh">
                   <cis:environment_variables>
                      <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                      <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                   </cis:environment_variables>
                </cis:evidence_sce>
             </cis:evidence_test>
          </cis:and>
          <cis:evidence_test comment="Ensure IPv6 loopback traffic is configured" result="unknown">
             <cis:evidence_sce exit-code="-1" full-path="" href="sce/ip6tables_output.sh">
                <cis:environment_variables>
                   <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
                   <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
                </cis:environment_variables>
             </cis:evidence_sce>
          </cis:evidence_test>
       </cis:and>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure /boot/grub/grub.cfg contents Pattern Match ipv6\.disable=1 (string)"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807121"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807121"
                          type="textfilecontent54_test">
          <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807121">
             <cis:evidence_item itemref="2683">
                <cis:evidence_item_pk status="exists">
                   <cis:evidence_item_pk_field name="filepath" value="/boot/grub/grub.cfg"/>
                   <cis:evidence_item_pk_field name="path" value="/boot/grub"/>
                   <cis:evidence_item_pk_field name="filename" value="grub.cfg"/>
                   <cis:evidence_item_pk_field name="pattern" value="^[^#]\s*linux.*$"/>
                   <cis:evidence_item_pk_field name="instance" value="1"/>
                   <cis:evidence_item_pk_field name="text"
                                               value="        linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro  quiet splash $vt_handoff"/>
                </cis:evidence_item_pk>
                <cis:evidence_field cv="        linux /boot/vmlinuz-4.15.0-163-generic root=UUID=5e30b0c8-c941-4a1f-9486-e98a0c509d44 ro  quiet splash $vt_handoff"
                                    dt="string"
                                    ev="ipv6\.disable=1"
                                    name="text"
                                    op="pattern match"
                                    result="false"/>
             </cis:evidence_item>
          </cis:evidence_state>
       </cis:evidence_test>
    </cis:or>
    <cis:evidence_test check="all" check_existence="any_exist"
                       comment="Ensure standard service 'iptables' is disabled"
                       negated="false"
                       ns="linux"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807123"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807123"
                       type="systemdunitproperty_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807123">
          <cis:evidence_item itemref="2684">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="unit" value="iptables"/>
                <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="" dt="string" ev="enabled" name="value" op="not equal" result="true"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'iptables' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807126"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807126"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2685">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="iptables"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<xccdf:complex-check operator="OR">
 <xccdf:complex-check operator="AND">
    <xccdf:complex-check operator="AND">
       <check system="http://open-scap.org/page/SCE">
          <check-import import-name="stdout"/>
          <check-export export-name="XCCDF_VALUE_REGEX"
                        value-id="xccdf_org.cisecurity.benchmarks_value_807104_var"/>
          <check-content-ref href="sce/ip6tables_input.sh"/>
       </check>
       <check system="http://open-scap.org/page/SCE">
          <check-import import-name="stdout"/>
          <check-export export-name="XCCDF_VALUE_REGEX"
                        value-id="xccdf_org.cisecurity.benchmarks_value_807112_var"/>
          <check-content-ref href="sce/ip6tables_input.sh"/>
       </check>
    </xccdf:complex-check>
    <check system="http://open-scap.org/page/SCE">
       <check-import import-name="stdout"/>
       <check-export export-name="XCCDF_VALUE_REGEX"
                     value-id="xccdf_org.cisecurity.benchmarks_value_807118_var"/>
       <check-content-ref href="sce/ip6tables_output.sh"/>
    </check>
 </xccdf:complex-check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807121"
                  value-id="xccdf_org.cisecurity.benchmarks_value_8071211_var"/>
    <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:8071212"
                  value-id="xccdf_org.cisecurity.benchmarks_value_8071212_var"/>
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807121"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807123"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807126"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Unknown

3.6 Ensure wireless interfaces are disabled

Description:

Wireless networking is used when wired networks are unavailable. Ubuntu contains a wireless tool kit to allow system administrators to configure and use wireless networks.

If wireless is not to be used, wireless devices can be disabled to reduce the potential attack surface.

Run the following command to disable any wireless interfaces:

# nmcli radio all off

Disable any wireless interfaces in your network configuration.less interfaces in your network configuration.

Impact:

Many if not all laptop workstations and some desktop workstations will connect via wireless requiring these interfaces be enabled.

Ensure wireless interfaces are disabled -- More
Script: sce/wireless_check.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_3.6_Ensure_wireless_interfaces_are_disabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:37.548+07:00"
  version="1"
  weight="1.0">
<result>unknown</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/15/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/15/subcontrol/5"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:37.548+07:00"
         start-time="2022-01-05T01:03:37.547+07:00">
<cis:and>
 <cis:evidence_test comment="Ensure wireless interfaces are disabled" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/wireless_check.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-content-ref href="sce/wireless_check.sh"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:
  • http://cisecurity.org/20-cc/v7.0:

4 Logging and Auditing

The items in this section describe how to configure logging, log monitoring, and auditing, using tools included in most distributions.

It is recommended that rsyslog be used for logging (with logwatch providing summarization) and auditd be used for auditing (with aureport providing summarization) to automatically monitor logs for intrusion attempts and other suspicious system behavior.

In addition to the local log files created by the steps in this section, it is also recommended that sites collect copies of their system logs on a secure, centralized log server via an encrypted connection. Not only does centralized logging help sites correlate events that may be occurring on multiple systems, but having a second copy of the system log information may be critical after a system compromise where the attacker has modified the local log files on the affected system(s). If a log correlation system is deployed, configure it to process the logs described in this section.

Because it is often necessary to correlate log information from many different systems (particularly after a security incident) it is recommended that the time be synchronized among systems and devices connected to the local network.

It is important that all logs described in this section be monitored on a regular basis and correlated to determine trends. A seemingly innocuous entry in one log could be more significant when compared to an entry in another log.

Note on log file permissions: There really isn't a "one size fits all" solution to the permissions on log files. Many sites utilize group permissions so that administrators who are in a defined security group, such as "wheel" do not have to elevate privileges to root in order to read log files. Also, if a third party log aggregation tool is used, it may need to have group permissions to read the log files, which is preferable to having it run setuid to root. Therefore, there are two remediation and audit steps for log file permissions. One is for systems that do not have a secured group method implemented that only permits root to read the log files ( root:root 600 ). The other is for sites that do have such a setup and are designated as root:securegrp 640 where securegrp is the defined security group (in some cases wheel ).

4.1 Configure System Accounting (auditd)

System auditing, through auditd , allows system administrators to monitor their systems such that they can detect unauthorized access or modification of data. By default, auditd will audit SELinux AVC denials, system logins, account modifications, and authentication events. Events will be logged to /var/log/audit/audit.log . The recording of these events will use a modest amount of disk space on a system. If significantly more events are captured, additional on system or off system storage may need to be allocated.

The recommendations in this section implement an audit policy that produces large quantities of logged data. In some environments it can be challenging to store or process these logs and as such they are marked as Level 2 for both Servers and Workstations. Note: For 64 bit systems that have arch as a rule parameter, you will need two rules: one for 64 bit and one for 32 bit systems. For 32 bit systems, only one rule is needed.

Note: Several recommendations in this section filter based off of auid>=1000 for unprivileged non-system users. Some distributions split at UID 500 instead, consult your documentation and/or the UID_MIN setting in /etc/login.defs to determine which is appropriate for you.

Note: Once all audit rules have been added to a file or files in the /etc/audit/rules.d/ directory, the auditd service must be re-started, or the system rebooted, for the new rules to be included.

4.1.1 Ensure auditing is enabled

The capturing of system events provides system administrators with information to allow them to determine if unauthorized access to their system is occurring.

4.1.2 Configure Data Retention

When auditing, it is important to carefully configure the storage requirements for audit logs. By default, auditd will max out the log files at 5MB and retain only 4 copies of them. Older versions will be deleted. It is possible on a system that the 20 MBs of audit logs may fill up the system causing loss of audit data. While the recommendations here provide guidance, check your site policy for audit storage requirements.

4.2 Configure Logging

Logging services should be configured to prevent information leaks and to aggregate logs on a remote server so that they can be reviewed in the event of a system compromise and ease log analysis.

4.2.1 Configure rsyslog

The rsyslog software is recommended as a replacement for the syslogd daemon and provides improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server. Note: This section only applies if rsyslog is installed on the system.

Pass

4.2.1.1 Ensure rsyslog is installed

Description:

The rsyslog software is a recommended replacement to the original syslogd daemon which provide improvements over syslogd , such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server.

The security enhancements of rsyslog such as connection-oriented (i.e. TCP) transmission of logs, the option to log to database formats, and the encryption of log data en route to a central logging server) justify installing and configuring the package.

Install rsyslog:

# apt install rsyslog

Ensure package name equals 'rsyslog' is installed -- More
CIS-CAT expected to collect at least 1 matching dpkg Package, and found 1 item.
Package Name: rsyslog exists

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_4.2.1.1_Ensure_rsyslog_is_installed"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:37.642+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/3"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:37.642+07:00"
         start-time="2022-01-05T01:03:37.614+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure package name equals 'rsyslog' is installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807036"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807036"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2686">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="name" value="rsyslog"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807036"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:
  • http://cisecurity.org/20-cc/v7.0:

Pass

4.2.1.2 Ensure rsyslog Service is enabled

Description:

Once the rsyslog package is installed it needs to be activated.

If the rsyslog service is not activated the system may default to the syslogd service or lack logging instead.

Run the following commands to enable rsyslog :

# systemctl --now enable rsyslog

Ensure standard service 'rsyslog' is enabled -- More
Check: All Must Pass
Unit: rsyslog
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to be set to enabled enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_4.2.1.2_Ensure_rsyslog_Service_is_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:37.745+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/3"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:37.745+07:00"
         start-time="2022-01-05T01:03:37.734+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure standard service 'rsyslog' is enabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806924"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806924"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806924">
       <cis:evidence_item itemref="2687">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="rsyslog"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="enabled" dt="string" ev="enabled" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806924"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:
  • http://cisecurity.org/20-cc/v7.0:

Pass

4.2.1.4 Ensure rsyslog default file permissions configured

Description:

rsyslog will create logfiles that do not already exist on the system. This setting controls what permissions will be applied to these newly created files.

It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected.

Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and set $FileCreateMode to 0640 or more restrictive:

$FileCreateMode 0640

Any of the following tests or sub-groups may pass:
Ensure at least one file named /etc/rsyslog.conf exists and matches pattern ^\s*\$FileCreateMode\s+0[6420][40]0\s*(\s+#.*)?$ -- More
CIS-CAT expected at least 1 matching text file content item to be collected, and found 1 item.
File: /etc/rsyslog.conf exists
Pattern: ^\s*\$FileCreateMode\s+0[6420][40]0\s*(\s+#.*)?$
Match Text: $FileCreateMode 0640
Ensure at least one file(s) named ^.+\.conf$ in /etc/rsyslog.d/ exists and matches pattern ^\s*\$FileCreateMode\s+0[6420][40]0\s*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/rsyslog.d/50-default.conf does not exist
Pattern: ^\s*\$FileCreateMode\s+0[6420][40]0\s*(\s+#.*)?$
Match Text: No match found
File: /etc/rsyslog.d/20-ufw.conf does not exist
Pattern: ^\s*\$FileCreateMode\s+0[6420][40]0\s*(\s+#.*)?$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_4.2.1.4_Ensure_rsyslog_default_file_permissions_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:37.812+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">See the rsyslog.conf(5) man page for more information.</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:37.812+07:00"
         start-time="2022-01-05T01:03:37.794+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/rsyslog.conf exists and matches pattern ^\s*\$FileCreateMode\s+0[6420][40]0\s*(\s+#.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806947"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806947"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2688">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/rsyslog.conf"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="rsyslog.conf"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*\$FileCreateMode\s+0[6420][40]0\s*(\s+#.*)?$"/>
             <cis:evidence_item_pk_field name="instance" value="1"/>
             <cis:evidence_item_pk_field name="text" value="$FileCreateMode 0640"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="at least one" check_existence="at_least_one_exists"
                    comment="Ensure at least one file(s) named ^.+\.conf$ in /etc/rsyslog.d/ exists and matches pattern ^\s*\$FileCreateMode\s+0[6420][40]0\s*(\s+#.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806956"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806956"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2691">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/rsyslog.d/50-default.conf"/>
             <cis:evidence_item_pk_field name="path" value="/etc/rsyslog.d"/>
             <cis:evidence_item_pk_field name="filename" value="50-default.conf"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*\$FileCreateMode\s+0[6420][40]0\s*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2692">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/rsyslog.d/20-ufw.conf"/>
             <cis:evidence_item_pk_field name="path" value="/etc/rsyslog.d"/>
             <cis:evidence_item_pk_field name="filename" value="20-ufw.conf"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*\$FileCreateMode\s+0[6420][40]0\s*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806947"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806956"/>
</check>
</complex-check>
</rule-result>

References:

Fail

4.2.1.5 Ensure rsyslog is configured to send logs to a remote log host

Description:

The rsyslog utility supports the ability to send logs it gathers to a remote log host running syslogd(8) or to receive messages from remote hosts, reducing administrative overhead.

Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system

Edit the /etc/rsyslog.conf and /etc/rsyslog.d/*.conf files and add one of the following lines:

Newer syntax:

<files to sent to the remote log server> action(type="omfwd" target="<FQDN or ip of loghost>" port="<port number>" protocol="tcp"
action.resumeRetryCount="<number of re-tries>"
queue.type="linkList" queue.size=<number of messages to queue>")

Example:

*.* action(type="omfwd" target="192.168.2.100" port"514" protocol="tcp"
action.resumeRetryCount="100"
queue.type="linkList" queue.size="1000")

Older syntax:

*.* @@<FQDN or ip of loghost>

Example:

*.* @@192.168.2.100

Run the following command to reload the rsyslog configuration:

# systemctl reload rsyslog

Any of the following tests or sub-groups may pass:
Ensure /etc/rsyslog.d//^.+\.conf$ contents Pattern Match target= (string) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/rsyslog.d//^.+\.conf$ does not exist
Pattern: ^[^#](\s*\S+\s*)\s*action\(.*$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure /etc//rsyslog.conf contents Pattern Match target= (string) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/rsyslog.conf does not exist
Pattern: ^[^#](\s*\S+\s*)\s*action\(.*$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure at least one file named /etc/rsyslog.conf exists and matches pattern ^\s*\*\.\*\s+\@ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/rsyslog.conf does not exist
Pattern: ^\s*\*\.\*\s+\@
Match Text: No match found
Ensure at least one file(s) named ^.+\.conf$ in /etc/rsyslog.d/ exists and matches pattern ^\s*\*\.\*\s+\@ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/rsyslog.d/50-default.conf does not exist
Pattern: ^\s*\*\.\*\s+\@
Match Text: No match found
File: /etc/rsyslog.d/20-ufw.conf does not exist
Pattern: ^\s*\*\.\*\s+\@
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_4.2.1.5_Ensure_rsyslog_is_configured_to_send_logs_to_a_remote_log_host"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:37.884+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/8"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">See the rsyslog.conf(5) man page for more information.</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:37.884+07:00"
         start-time="2022-01-05T01:03:37.863+07:00">
<cis:or>
 <cis:or>
    <cis:or>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure at least one file named /etc/rsyslog.conf exists and matches pattern ^\s*\*\.\*\s+\@"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806974"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806974"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2693">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/rsyslog.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc"/>
                   <cis:evidence_item_pk_field name="filename" value="rsyslog.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*\*\.\*\s+\@"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
       <cis:evidence_test check="at least one" check_existence="at_least_one_exists"
                          comment="Ensure at least one file(s) named ^.+\.conf$ in /etc/rsyslog.d/ exists and matches pattern ^\s*\*\.\*\s+\@"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806982"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806982"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2696">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/rsyslog.d/50-default.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/rsyslog.d"/>
                   <cis:evidence_item_pk_field name="filename" value="50-default.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*\*\.\*\s+\@"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
             <cis:evidence_item itemref="2697">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/rsyslog.d/20-ufw.conf"/>
                   <cis:evidence_item_pk_field name="path" value="/etc/rsyslog.d"/>
                   <cis:evidence_item_pk_field name="filename" value="20-ufw.conf"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*\*\.\*\s+\@"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:or>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure /etc//rsyslog.conf contents Pattern Match target= (string)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806994"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806994"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2698">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/rsyslog.conf"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="rsyslog.conf"/>
                <cis:evidence_item_pk_field name="pattern" value="^[^#](\s*\S+\s*)\s*action\(.*$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:or>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure /etc/rsyslog.d//^.+\.conf$ contents Pattern Match target= (string)"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807009"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807009"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2699">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="path" value="/etc/rsyslog.d/"/>
             <cis:evidence_item_pk_field name="filename" value="^.+\.conf$"/>
             <cis:evidence_item_pk_field name="pattern" value="^[^#](\s*\S+\s*)\s*action\(.*$"/>
             <cis:evidence_item_pk_field name="instance" value="1"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="OR">
<xccdf:complex-check operator="OR">
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806974"/>
 </check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806982"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806994"
               value-id="xccdf_org.cisecurity.benchmarks_value_8069941_var"/>
 <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:8069942"
               value-id="xccdf_org.cisecurity.benchmarks_value_8069942_var"/>
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806994"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807009"
            value-id="xccdf_org.cisecurity.benchmarks_value_8070091_var"/>
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:8070092"
            value-id="xccdf_org.cisecurity.benchmarks_value_8070092_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807009"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:
  • http://cisecurity.org/20-cc/v7.0:
  • CCE-IDv5: See the rsyslog.conf(5) man page for more information. -- More
    CCE Information
    CCE-IDv5: See the rsyslog.conf(5) man page for more information.
    Published On:
    Last Modified On:

4.2.2 Configure journald

systemd-journald is a system service that collects and stores logging data. It creates and maintains structured, indexed journals based on logging information that is received from a variety of sources: Kernel log messages, via kmsg

Any changes made to the systemd-journald configuration will require a re-start of systemd-journald

Fail

4.2.2.1 Ensure journald is configured to send logs to rsyslog

Description:

Data from journald may be stored in volatile memory or persisted locally on the server. Utilities exist to accept remote export of journald logs, however, use of the rsyslog service provides a consistent means of log collection and export.

Storing log data on a remote host protects log integrity from local attacks. If an attacker gains root access on the local system, they could tamper with or remove log data that is stored on the local system.

Edit the /etc/systemd/journald.conf file and add the following line:

ForwardToSyslog=yes

Ensure at least one file named /etc/systemd/journald.conf exists and matches pattern ^\s*(?i)ForwardToSyslog\s*=\s*yes(\s+#.*)*$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/systemd/journald.conf does not exist
Pattern: ^\s*(?i)ForwardToSyslog\s*=\s*yes(\s+#.*)*$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_4.2.2.1_Ensure_journald_is_configured_to_send_logs_to_rsyslog"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:38.038+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/5"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:38.038+07:00"
         start-time="2022-01-05T01:03:38.025+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/systemd/journald.conf exists and matches pattern ^\s*(?i)ForwardToSyslog\s*=\s*yes(\s+#.*)*$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806936"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806936"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2700">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/systemd/journald.conf"/>
             <cis:evidence_item_pk_field name="path" value="/etc/systemd"/>
             <cis:evidence_item_pk_field name="filename" value="journald.conf"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*(?i)ForwardToSyslog\s*=\s*yes(\s+#.*)*$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806936"/>
</check>
</complex-check>
</rule-result>

References:

Fail

4.2.2.2 Ensure journald is configured to compress large log files

Description:

The journald system includes the capability of compressing overly large files to avoid filling up the system with logs or making the logs unmanageably large.

Uncompressed large files may unexpectedly fill a filesystem leading to resource unavailability. Compressing logs prior to write can prevent sudden, unexpected filesystem impacts.

Edit the /etc/systemd/journald.conf file and add the following line:

Compress=yes

Ensure at least one file named /etc/systemd/journald.conf exists and matches pattern ^\s*(?i)Compress\s*=\s*yes(\s+#.*)*$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/systemd/journald.conf does not exist
Pattern: ^\s*(?i)Compress\s*=\s*yes(\s+#.*)*$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_4.2.2.2_Ensure_journald_is_configured_to_compress_large_log_files"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:38.042+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:38.043+07:00"
         start-time="2022-01-05T01:03:38.041+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/systemd/journald.conf exists and matches pattern ^\s*(?i)Compress\s*=\s*yes(\s+#.*)*$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806945"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806945"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2701">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/systemd/journald.conf"/>
             <cis:evidence_item_pk_field name="path" value="/etc/systemd"/>
             <cis:evidence_item_pk_field name="filename" value="journald.conf"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*(?i)Compress\s*=\s*yes(\s+#.*)*$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806945"/>
</check>
</complex-check>
</rule-result>

References:

Fail

4.2.2.3 Ensure journald is configured to write logfiles to persistent disk

Description:

Data from journald may be stored in volatile memory or persisted locally on the server. Logs in memory will be lost upon a system reboot. By persisting logs to local disk on the server they are protected from loss.

Writing log data to disk will provide the ability to forensically reconstruct events which may have impacted the operations or security of a system even after a system crash or reboot.

Edit the /etc/systemd/journald.conf file and add the following line:

Storage=persistent

Ensure at least one file named /etc/systemd/journald.conf exists and matches pattern ^\s*(?i)Storage\s*=\s*persistent(\s+#.*)*$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/systemd/journald.conf does not exist
Pattern: ^\s*(?i)Storage\s*=\s*persistent(\s+#.*)*$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_4.2.2.3_Ensure_journald_is_configured_to_write_logfiles_to_persistent_disk"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:38.046+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/3"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">https://github.com/konstruktoid/hardening/blob/master/systemd.adoc#etcsystemdjournaldconf</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:38.046+07:00"
         start-time="2022-01-05T01:03:38.044+07:00">
<cis:and>
 <cis:evidence_test check="at least one" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/systemd/journald.conf exists and matches pattern ^\s*(?i)Storage\s*=\s*persistent(\s+#.*)*$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806955"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806955"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2702">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/systemd/journald.conf"/>
             <cis:evidence_item_pk_field name="path" value="/etc/systemd"/>
             <cis:evidence_item_pk_field name="filename" value="journald.conf"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*(?i)Storage\s*=\s*persistent(\s+#.*)*$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806955"/>
</check>
</complex-check>
</rule-result>

References:

Fail

4.2.3 Ensure permissions on all logfiles are configured

Description:

Log files stored in /var/log/ contain logged information from many services on the system, or on log hosts others as well.

It is important to ensure that log files have the correct permissions to ensure that sensitive data is archived and protected.

Run the following commands to set permissions on all existing log files:

find /var/log -type f -exec chmod g-wx,o-rwx "{}" + -o -type d -exec chmod g-w,o-rwx "{}" +

Ensure any file(s) named ^.+$ in /var/log exists and does not have permissions ----wxrwx -- Less
File: /var/log/vmware-vmsvc.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/vmware-vmtoolsd-root.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/btmp
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false true
File: /var/log/apt/eipp.log.xz
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/apt/term.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/apt/history.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/dpkg.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/alternatives.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/wtmp
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false true
File: /var/log/fontconfig.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/ubuntu-advantage.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/auth.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/kern.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/boot.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/faillog
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/cups/access_log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/bootstrap.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/installer/casper.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/installer/telemetry
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/installer/debug
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/installer/partman
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/installer/version
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/installer/media-info
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/installer/syslog
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/installer/initial-status.gz
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false true
File: /var/log/lastlog
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false true
File: /var/log/unattended-upgrades/unattended-upgrades-shutdown.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/vmware-install.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/journal/d7a67ce67a564e45a1151b070d2a6369/system.journal
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/journal/d7a67ce67a564e45a1151b070d2a6369/user-1000.journal
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/vmware-vgauthsvc.log.0
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/syslog
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/gpu-manager.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/vmware-network.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/tallylog
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /var/log/vmware-vmsvc-root.log
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_4.2.3_Ensure_permissions_on_all_logfiles_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:38.877+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/13"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:38.878+07:00"
         start-time="2022-01-05T01:03:38.054+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure any file(s) named ^.+$ in /var/log exists and does not have permissions ----wxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806713"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806713"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806713">
       <cis:evidence_item itemref="2739">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/vmware-vmsvc.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="vmware-vmsvc.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2740">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/vmware-vmtoolsd-root.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="vmware-vmtoolsd-root.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2741">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/btmp"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="btmp"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gwrite" op="equals" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2742">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/apt/eipp.log.xz"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/apt"/>
             <cis:evidence_item_pk_field name="filename" value="eipp.log.xz"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2743">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/apt/term.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/apt"/>
             <cis:evidence_item_pk_field name="filename" value="term.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2744">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/apt/history.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/apt"/>
             <cis:evidence_item_pk_field name="filename" value="history.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2745">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/dpkg.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="dpkg.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2746">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/alternatives.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="alternatives.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2747">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/wtmp"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="wtmp"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gwrite" op="equals" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2748">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/fontconfig.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="fontconfig.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2749">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/ubuntu-advantage.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="ubuntu-advantage.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2750">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/auth.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="auth.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2751">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/kern.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="kern.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2752">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/boot.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="boot.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2753">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/faillog"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="faillog"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2754">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/cups/access_log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/cups"/>
             <cis:evidence_item_pk_field name="filename" value="access_log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2755">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/bootstrap.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="bootstrap.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2756">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/installer/casper.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/installer"/>
             <cis:evidence_item_pk_field name="filename" value="casper.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2757">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/installer/telemetry"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/installer"/>
             <cis:evidence_item_pk_field name="filename" value="telemetry"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2758">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/installer/debug"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/installer"/>
             <cis:evidence_item_pk_field name="filename" value="debug"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2759">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/installer/partman"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/installer"/>
             <cis:evidence_item_pk_field name="filename" value="partman"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2760">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/installer/version"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/installer"/>
             <cis:evidence_item_pk_field name="filename" value="version"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2761">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/installer/media-info"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/installer"/>
             <cis:evidence_item_pk_field name="filename" value="media-info"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2762">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/installer/syslog"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/installer"/>
             <cis:evidence_item_pk_field name="filename" value="syslog"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2763">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/installer/initial-status.gz"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/installer"/>
             <cis:evidence_item_pk_field name="filename" value="initial-status.gz"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gwrite" op="equals" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2764">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/lastlog"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="lastlog"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gwrite" op="equals" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2765">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath"
                                         value="/var/log/unattended-upgrades/unattended-upgrades-shutdown.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/unattended-upgrades"/>
             <cis:evidence_item_pk_field name="filename" value="unattended-upgrades-shutdown.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2766">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/vmware-install.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="vmware-install.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2767">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath"
                                         value="/var/log/journal/d7a67ce67a564e45a1151b070d2a6369/system.journal"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/journal/d7a67ce67a564e45a1151b070d2a6369"/>
             <cis:evidence_item_pk_field name="filename" value="system.journal"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2768">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath"
                                         value="/var/log/journal/d7a67ce67a564e45a1151b070d2a6369/user-1000.journal"/>
             <cis:evidence_item_pk_field name="path" value="/var/log/journal/d7a67ce67a564e45a1151b070d2a6369"/>
             <cis:evidence_item_pk_field name="filename" value="user-1000.journal"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2769">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/vmware-vgauthsvc.log.0"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="vmware-vgauthsvc.log.0"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2770">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/syslog"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="syslog"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2771">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/gpu-manager.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="gpu-manager.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2772">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/vmware-network.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="vmware-network.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2773">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/tallylog"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="tallylog"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2774">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/var/log/vmware-vmsvc-root.log"/>
             <cis:evidence_item_pk_field name="path" value="/var/log"/>
             <cis:evidence_item_pk_field name="filename" value="vmware-vmsvc-root.log"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806713"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

5 Access, Authentication and Authorization

5.1 Configure cron

Pass

5.1.1 Ensure cron daemon is enabled

Description:

The cron daemon is used to execute batch jobs on the system.

While there may not be user jobs that need to be run on the system, the system does have maintenance jobs that may include security monitoring that have to run, and cron is used to execute them.

Based on your system configuration, run the appropriate one of the following commands to enable cron :

# systemctl --now enable cron

Ensure standard service 'cron' is enabled -- More
Check: All Must Pass
Unit: cron
Property: UnitFileState
CIS-CAT Expected... CIS-CAT Collected...
the Value to be set to enabled enabled

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.1.1_Ensure_cron_daemon_is_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:39.007+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:39.008+07:00"
         start-time="2022-01-05T01:03:38.984+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure standard service 'cron' is enabled"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806735"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806735"
                    type="systemdunitproperty_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806735">
       <cis:evidence_item itemref="2775">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="unit" value="cron"/>
             <cis:evidence_item_pk_field name="property" value="UnitFileState"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="enabled" dt="string" ev="enabled" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806735"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.1.2 Ensure permissions on /etc/crontab are configured

Description:

The /etc/crontab file is used by cron to control its own jobs. The commands in this item make sure that root is the user and group owner of the file and that only the owner can access the file.

This file contains information on what system jobs are run by cron. Write access to these files could provide unprivileged users with the ability to elevate their privileges. Read access to these files could provide users with the ability to gain insight on system jobs that run on the system and could provide them a way to gain unauthorized privileged access.

Run the following commands to set ownership and permissions on /etc/crontab :

# chown root:root /etc/crontab # chmod og-rwx /etc/crontab

Ensure at least one file named /etc/crontab exists and is owned by 0:0 and does not have permissions ---rwxrwx -- Less
File: /etc/crontab
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Read to be set to false true
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.1.2_Ensure_permissions_on_etccrontab_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:39.084+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:39.085+07:00"
         start-time="2022-01-05T01:03:39.052+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/crontab exists and is owned by 0:0 and does not have permissions ---rwxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806746"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806746"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806746">
       <cis:evidence_item itemref="2776">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/crontab"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="crontab"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806746"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.1.3 Ensure permissions on /etc/cron.hourly are configured

Description:

This directory contains system cron jobs that need to run on an hourly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory.

Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls.

Run the following commands to set ownership and permissions on /etc/cron.hourly :

# chown root:root /etc/cron.hourly # chmod og-rwx /etc/cron.hourly

Ensure at least one file named /etc/cron.hourly/ exists and is owned by 0:0 and does not have permissions ---rwxrwx -- Less
File: /etc/cron.hourly
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false true
the file's Other Read to be set to false true
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Other Execute to be set to false true
the file's Other Write to be set to false false
the file's Group Read to be set to false true
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.1.3_Ensure_permissions_on_etccron.hourly_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:39.182+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:39.182+07:00"
         start-time="2022-01-05T01:03:39.127+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/cron.hourly/ exists and is owned by 0:0 and does not have permissions ---rwxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806756"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806756"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806756">
       <cis:evidence_item itemref="2778">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/cron.hourly"/>
             <cis:evidence_item_pk_field name="path" value="/etc/cron.hourly"/>
             <cis:evidence_item_pk_field name="filename" value="NIL"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gexec" op="equals" result="false"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oexec" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806756"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.1.4 Ensure permissions on /etc/cron.daily are configured

Description:

The /etc/cron.daily directory contains system cron jobs that need to run on a daily basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory.

Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls.

Run the following commands to set ownership and permissions on /etc/cron.daily :

# chown root:root /etc/cron.daily # chmod og-rwx /etc/cron.daily

Ensure at least one file named /etc/cron.daily/ exists and is owned by 0:0 and does not have permissions ---rwxrwx -- Less
File: /etc/cron.daily
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false true
the file's Other Read to be set to false true
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Other Execute to be set to false true
the file's Other Write to be set to false false
the file's Group Read to be set to false true
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.1.4_Ensure_permissions_on_etccron.daily_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:39.254+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:39.254+07:00"
         start-time="2022-01-05T01:03:39.190+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/cron.daily/ exists and is owned by 0:0 and does not have permissions ---rwxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806769"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806769"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806769">
       <cis:evidence_item itemref="2780">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/cron.daily"/>
             <cis:evidence_item_pk_field name="path" value="/etc/cron.daily"/>
             <cis:evidence_item_pk_field name="filename" value="NIL"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gexec" op="equals" result="false"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oexec" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806769"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.1.5 Ensure permissions on /etc/cron.weekly are configured

Description:

The /etc/cron.weekly directory contains system cron jobs that need to run on a weekly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory.

Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls.

Run the following commands to set ownership and permissions on /etc/cron.weekly :

# chown root:root /etc/cron.weekly # chmod og-rwx /etc/cron.weekly

Ensure at least one file named /etc/cron.weekly/ exists and is owned by 0:0 and does not have permissions ---rwxrwx -- Less
File: /etc/cron.weekly
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false true
the file's Other Read to be set to false true
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Other Execute to be set to false true
the file's Other Write to be set to false false
the file's Group Read to be set to false true
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.1.5_Ensure_permissions_on_etccron.weekly_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:39.402+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:39.403+07:00"
         start-time="2022-01-05T01:03:39.323+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/cron.weekly/ exists and is owned by 0:0 and does not have permissions ---rwxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806780"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806780"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806780">
       <cis:evidence_item itemref="2782">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/cron.weekly"/>
             <cis:evidence_item_pk_field name="path" value="/etc/cron.weekly"/>
             <cis:evidence_item_pk_field name="filename" value="NIL"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gexec" op="equals" result="false"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oexec" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806780"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.1.6 Ensure permissions on /etc/cron.monthly are configured

Description:

The /etc/cron.monthly directory contains system cron jobs that need to run on a monthly basis. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory.

Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls.

Run the following commands to set ownership and permissions on /etc/cron.monthly :

# chown root:root /etc/cron.monthly # chmod og-rwx /etc/cron.monthly

Ensure at least one file named /etc/cron.monthly/ exists and is owned by 0:0 and does not have permissions ---rwxrwx -- Less
File: /etc/cron.monthly
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false true
the file's Other Read to be set to false true
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Other Execute to be set to false true
the file's Other Write to be set to false false
the file's Group Read to be set to false true
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.1.6_Ensure_permissions_on_etccron.monthly_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:39.462+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:39.462+07:00"
         start-time="2022-01-05T01:03:39.405+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/cron.monthly/ exists and is owned by 0:0 and does not have permissions ---rwxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806797"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806797"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806797">
       <cis:evidence_item itemref="2784">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/cron.monthly"/>
             <cis:evidence_item_pk_field name="path" value="/etc/cron.monthly"/>
             <cis:evidence_item_pk_field name="filename" value="NIL"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gexec" op="equals" result="false"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oexec" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806797"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.1.7 Ensure permissions on /etc/cron.d are configured

Description:

The /etc/cron.d directory contains system cron jobs that need to run in a similar manner to the hourly, daily weekly and monthly jobs from /etc/crontab , but require more granular control as to when they run. The files in this directory cannot be manipulated by the crontab command, but are instead edited by system administrators using a text editor. The commands below restrict read/write and search access to user and group root, preventing regular users from accessing this directory.

Granting write access to this directory for non-privileged users could provide them the means for gaining unauthorized elevated privileges. Granting read access to this directory could give an unprivileged user insight in how to gain elevated privileges or circumvent auditing controls.

Run the following commands to set ownership and permissions on /etc/cron.d :

# chown root:root /etc/cron.d # chmod og-rwx /etc/cron.d

Ensure at least one file named /etc/cron.d/ exists and is owned by 0:0 and does not have permissions ---rwxrwx -- Less
File: /etc/cron.d
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false true
the file's Other Read to be set to false true
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Other Execute to be set to false true
the file's Other Write to be set to false false
the file's Group Read to be set to false true
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.1.7_Ensure_permissions_on_etccron.d_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:39.509+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:39.510+07:00"
         start-time="2022-01-05T01:03:39.481+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/cron.d/ exists and is owned by 0:0 and does not have permissions ---rwxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806813"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806813"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806813">
       <cis:evidence_item itemref="2786">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/cron.d"/>
             <cis:evidence_item_pk_field name="path" value="/etc/cron.d"/>
             <cis:evidence_item_pk_field name="filename" value="NIL"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gexec" op="equals" result="false"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oexec" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806813"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.1.8 Ensure at/cron is restricted to authorized users

Description:

Configure /etc/cron.allow and /etc/at.allow to allow specific users to use these services. If /etc/cron.allow or /etc/at.allow do not exist, then /etc/at.deny and /etc/cron.deny are checked. Any user not specifically defined in those files is allowed to use at and cron. By removing the files, only users in /etc/cron.allow and /etc/at.allow are allowed to use at and cron. Note that even though a given user is not listed in cron.allow , cron jobs can still be run as that user. The cron.allow file only controls administrative access to the crontab command for scheduling and modifying cron jobs.

On many systems, only the system administrator is authorized to schedule cron jobs. Using the cron.allow file to control who can run cron jobs enforces this policy. It is easier to manage an allow list than a deny list. In a deny list, you could potentially add a user ID to the system and forget to add it to the deny files.

Run the following commands to remove /etc/cron.deny and /etc/at.deny and create and set permissions and ownership for /etc/cron.allow and /etc/at.allow :

# rm /etc/cron.deny
# rm /etc/at.deny

# touch /etc/cron.allow
# touch /etc/at.allow

# chmod o-rwx /etc/cron.allow
# chmod g-wx /etc/cron.allow
# chmod o-rwx /etc/at.allow
# chmod g-wx /etc/at.allow

# chown root:root /etc/cron.allow
# chown root:root /etc/at.allow

All of the following tests or sub-groups must pass:
Ensure at least one file named /etc/cron.allow exists and is owned by 0:0 and does not have permissions ----wxrwx -- Less
CIS-CAT expected at least 1 matching file item to be collected, and found 0 items.
File: /etc/cron.allow does not exist
All of the following tests or sub-groups must pass:
Ensure no file named /etc/at.deny exists and unknown test -- More
CIS-CAT did not expect to collect any file items, and found 0 items.
File: /etc/at.deny does not exist
All of the following tests or sub-groups must pass:
Ensure at least one file named /etc/at.allow exists and is owned by 0:0 and does not have permissions ----wxrwx -- Less
CIS-CAT expected at least 1 matching file item to be collected, and found 0 items.
File: /etc/at.allow does not exist
Ensure no file named /etc/cron.deny exists and unknown test -- More
CIS-CAT did not expect to collect any file items, and found 0 items.
File: /etc/cron.deny does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.1.8_Ensure_atcron_is_restricted_to_authorized_users"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:39.571+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:39.572+07:00"
         start-time="2022-01-05T01:03:39.563+07:00">
<cis:and>
 <cis:and>
    <cis:and>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure at least one file named /etc/at.allow exists and is owned by 0:0 and does not have permissions ----wxrwx"
                          negated="false"
                          ns="unix"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806826"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806826"
                          type="file_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2787">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/at.allow"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
       <cis:evidence_test check="all" check_existence="none_exist"
                          comment="Ensure no file named /etc/cron.deny exists and unknown test"
                          negated="false"
                          ns="unix"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806838"
                          result="true"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806838"
                          type="file_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2788">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/cron.deny"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:and>
    <cis:evidence_test check="all" check_existence="none_exist"
                       comment="Ensure no file named /etc/at.deny exists and unknown test"
                       negated="false"
                       ns="unix"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806846"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806846"
                       type="file_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2789">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/at.deny"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/cron.allow exists and is owned by 0:0 and does not have permissions ----wxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806855"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806855"
                    type="file_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2790">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/cron.allow"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<xccdf:complex-check operator="AND">
<xccdf:complex-check operator="AND">
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806826"/>
 </check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806838"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806846"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806855"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

5.2 SSH Server Configuration

SSH is a secure, encrypted replacement for common login services such as telnet , ftp , rlogin , rsh , and rcp . It is strongly recommended that sites abandon older clear-text login protocols and use SSH to prevent session hijacking and sniffing of sensitive data off the network.

Note: The recommendations in this section only apply if the SSH daemon is installed on the system, if remote access is not required the SSH daemon can be removed and this section skipped.

Command to remove the SSH daemon:

# apt purge openssh-server

Note: Once all configuration changes have been made to /etc/ssh/sshd_config , the sshd configuration must be reloaded:

Command to re-load the SSH daemon configuration:

# systemctl reload sshd
Pass

5.2.1 Ensure permissions on /etc/ssh/sshd_config are configured

Description:

The /etc/ssh/sshd_config file contains configuration specifications for sshd . The command below sets the owner and group of the file to root.

The /etc/ssh/sshd_config file needs to be protected from unauthorized changes by non-privileged users.

Run the following commands to set ownership and permissions on /etc/ssh/sshd_config :

# chown root:root /etc/ssh/sshd_config # chmod og-rwx /etc/ssh/sshd_config

Any of the following tests or sub-groups may pass:
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist
Ensure at least one file named /etc/ssh/sshd_config exists and is owned by 0:0 and does not have permissions ---rwxrwx -- Less
CIS-CAT expected at least 1 matching file item to be collected, and found 0 items.
File: /etc/ssh/sshd_config does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.1_Ensure_permissions_on_etcsshsshd_config_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:40.927+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:40.927+07:00"
         start-time="2022-01-05T01:03:40.829+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806828"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806828"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2801">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/ssh/sshd_config exists and is owned by 0:0 and does not have permissions ---rwxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806818"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806818"
                    type="file_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2802">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/ssh/sshd_config"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806818"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806828"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.2 Ensure permissions on SSH private host key files are configured

Description:

An SSH private key is one of two files used in SSH public key authentication. In this authentication method, The possession of the private key is proof of identity. Only a private key that corresponds to a public key will be able to authenticate successfully. The private keys need to be stored and handled carefully, and no copies of the private key should be distributed.

If an unauthorized user obtains the private SSH host key file, the host could be impersonated

Run the following commands to set ownership and permissions on the private SSH host key files

# find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chown root:root {} \; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key' -exec chmod 0600 {} \;

Any of the following tests or sub-groups may pass:
Ensure any file(s) named ^(ssh\_host\_.*\_key)$ in /etc/ssh exists and is owned by 0:0 and does not have permissions ---rwxrwx -- More
No testable evidence items were collected. Any number of items (including none) are expected for this test. In this case, when no evidence items are collected, the test Passes.
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.2_Ensure_permissions_on_SSH_private_host_key_files_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:41.472+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:41.473+07:00"
         start-time="2022-01-05T01:03:41.368+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Ensure any file(s) named ^(ssh\_host\_.*\_key)$ in /etc/ssh exists and is owned by 0:0 and does not have permissions ---rwxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807023"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807023"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807023"/>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807034"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807034"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2807">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807023"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807034"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.3 Ensure permissions on SSH public host key files are configured

Description:

An SSH public key is one of two files used in SSH public key authentication. In this authentication method, a public key is a key that can be used for verifying digital signatures generated using a corresponding private key. Only a public key that corresponds to a private key will be able to authenticate successfully.

If a public host key file is modified by an unauthorized user, the SSH service may be compromised.

Run the following commands to set permissions and ownership on the SSH host public key files

# find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chmod 0644 {} \; # find /etc/ssh -xdev -type f -name 'ssh_host_*_key.pub' -exec chown root:root {} \;

Any of the following tests or sub-groups may pass:
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist
Ensure all {else} no file(s) named ^(ssh\_host\_.*\_key\.pub)$ in /etc/ssh exists and is owned by 0:0 and does not have permissions ----wx-wx -- Less
CIS-CAT expected every collected file item to exist on the target system, and found 0 items.
File: /etc/ssh/^(ssh\_host\_.*\_key\.pub)$ does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.3_Ensure_permissions_on_SSH_public_host_key_files_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:41.615+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:41.615+07:00"
         start-time="2022-01-05T01:03:41.523+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807056"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807056"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2808">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="all_exist"
                    comment="Ensure all {else} no file(s) named ^(ssh\_host\_.*\_key\.pub)$ in /etc/ssh exists and is owned by 0:0 and does not have permissions ----wx-wx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807043"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807043"
                    type="file_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2809">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="path" value="/etc/ssh"/>
             <cis:evidence_item_pk_field name="filename" value="^(ssh\_host\_.*\_key\.pub)$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807043"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807056"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.4 Ensure SSH Protocol is not set to 1

Description:

Older versions of SSH support two different and incompatible protocols: SSH1 and SSH2. SSH1 was the original protocol and was subject to security issues. SSH2 is more advanced and secure.

SSH v1 suffers from insecurities that do not affect SSH v2.

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

Protocol 2

Any of the following tests or sub-groups may pass:
Ensure no file named /etc/ssh/sshd_config exists and matches pattern ^\s*(?i)protocol\s+(1|1\s*,\s*2|2\s*,\s*1)\s* -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/ssh/sshd_config does not exist
Pattern: ^\s*(?i)protocol\s+(1|1\s*,\s*2|2\s*,\s*1)\s*
Match Text: No match found
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.4_Ensure_SSH_Protocol_is_not_set_to_1"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:41.697+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/5"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:41.697+07:00"
         start-time="2022-01-05T01:03:41.665+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure no file named /etc/ssh/sshd_config exists and matches pattern ^\s*(?i)protocol\s+(1|1\s*,\s*2|2\s*,\s*1)\s*"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806833"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806833"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2810">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/ssh/sshd_config"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*(?i)protocol\s+(1|1\s*,\s*2|2\s*,\s*1)\s*"/>
             <cis:evidence_item_pk_field name="instance" value="1"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806837"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806837"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2811">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806833"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806837"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:
  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.5 Ensure SSH LogLevel is appropriate

Description:

INFO level is the basic level that only records login activity of SSH users. In many situations, such as Incident Response, it is important to determine when a particular user was active on a system. The logout record can eliminate those users who disconnected, which helps narrow the field.

VERBOSE level specifies that login and logout activity as well as the key fingerprint for any SSH key used for login will be logged. This information is important for SSH key management, especially in legacy environments.

SSH provides several logging levels with varying amounts of verbosity. DEBUG is specifically not recommended other than strictly for debugging SSH communications since it provides so much data that it is difficult to identify important security information.

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

LogLevel VERBOSE

OR

LogLevel INFO

Any of the following tests or sub-groups may pass:
Ensure SSH LogLevel is appropriate -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.5_Ensure_SSH_LogLevel_is_appropriate"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:41.819+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/6/subcontrol/3"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">https://www.ssh.com/ssh/sshd_config/</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:41.820+07:00"
         start-time="2022-01-05T01:03:41.731+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure SSH LogLevel is appropriate" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806851"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806851"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2812">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806845_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806851"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:
  • http://cisecurity.org/20-cc/v7.0:
  • CCE-IDv5: https://www.ssh.com/ssh/sshd_config/ -- More
    CCE Information
    CCE-IDv5: https://www.ssh.com/ssh/sshd_config/
    Published On:
    Last Modified On:

Pass

5.2.7 Ensure SSH MaxAuthTries is set to 4 or less

Description:

The MaxAuthTries parameter specifies the maximum number of authentication attempts permitted per connection. When the login failure count reaches half the number, error messages will be written to the syslog file detailing the login failure.

Setting the MaxAuthTries parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. While the recommended setting is 4, set the number based on site policy.

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

MaxAuthTries 4

Any of the following tests or sub-groups may pass:
Ensure SSH MaxAuthTries is set to 4 or less -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.7_Ensure_SSH_MaxAuthTries_is_set_to_4_or_less"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:41.971+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/13"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:41.972+07:00"
         start-time="2022-01-05T01:03:41.868+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure SSH MaxAuthTries is set to 4 or less" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806870"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806870"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2813">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806866_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806870"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.8 Ensure SSH IgnoreRhosts is enabled

Description:

The IgnoreRhosts parameter specifies that .rhosts and .shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication .

Setting this parameter forces users to enter a password when authenticating with ssh.

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

IgnoreRhosts yes

Any of the following tests or sub-groups may pass:
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist
Ensure SSH IgnoreRhosts is enabled -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.8_Ensure_SSH_IgnoreRhosts_is_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:42.072+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/9/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:42.072+07:00"
         start-time="2022-01-05T01:03:42.023+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806880"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806880"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2814">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test comment="Ensure SSH IgnoreRhosts is enabled" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806876_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806880"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.9 Ensure SSH HostbasedAuthentication is disabled

Description:

The HostbasedAuthentication parameter specifies if authentication is allowed through trusted hosts via the user of .rhosts , or /etc/hosts.equiv , along with successful public key client host authentication. This option only applies to SSH Protocol Version 2.

Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf , disabling the ability to use .rhosts files in SSH provides an additional layer of protection.

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

HostbasedAuthentication no

Any of the following tests or sub-groups may pass:
Ensure SSH HostbasedAuthentication is disabled -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.9_Ensure_SSH_HostbasedAuthentication_is_disabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:42.271+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/3"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:42.271+07:00"
         start-time="2022-01-05T01:03:42.192+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure SSH HostbasedAuthentication is disabled" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806889"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806889"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2815">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806888_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806889"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.10 Ensure SSH root login is disabled

Description:

The PermitRootLogin parameter specifies if the root user can log in using ssh. The default is no.

Disallowing root logins over SSH requires system admins to authenticate using their own individual account, then escalating to root via sudo or su . This in turn limits opportunity for non-repudiation and provides a clear audit trail in the event of a security incident

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

PermitRootLogin no

Any of the following tests or sub-groups may pass:
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist
Ensure SSH root login is disabled -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.10_Ensure_SSH_root_login_is_disabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:39.734+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/3"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:39.734+07:00"
         start-time="2022-01-05T01:03:39.638+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806901"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806901"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2791">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test comment="Ensure SSH root login is disabled" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806896_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806901"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.11 Ensure SSH PermitEmptyPasswords is disabled

Description:

The PermitEmptyPasswords parameter specifies if the SSH server allows login to accounts with empty password strings.

Disallowing remote shell access to accounts that have an empty password reduces the probability of unauthorized access to the system

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

PermitEmptyPasswords no

Any of the following tests or sub-groups may pass:
Ensure SSH PermitEmptyPasswords is disabled -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.11_Ensure_SSH_PermitEmptyPasswords_is_disabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:39.781+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/3"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:39.782+07:00"
         start-time="2022-01-05T01:03:39.738+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure SSH PermitEmptyPasswords is disabled" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806913"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806913"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2792">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806908_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806913"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.12 Ensure SSH PermitUserEnvironment is disabled

Description:

The PermitUserEnvironment option allows users to present environment options to the ssh daemon.

Permitting users the ability to set environment variables through the SSH daemon could potentially allow users to bypass security controls (e.g. setting an execution path that has ssh executing trojan'd programs)

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

PermitUserEnvironment no

Any of the following tests or sub-groups may pass:
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist
Ensure SSH PermitUserEnvironment is disabled -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.12_Ensure_SSH_PermitUserEnvironment_is_disabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:39.932+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:39.932+07:00"
         start-time="2022-01-05T01:03:39.836+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806926"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806926"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2793">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test comment="Ensure SSH PermitUserEnvironment is disabled" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806919_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806926"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.13 Ensure only strong Ciphers are used

Description:

This variable limits the ciphers that SSH can use during communication.

Weak ciphers that are used for authentication to the cryptographic module cannot be relied upon to provide confidentiality or integrity, and system data may be compromised

The DES, Triple DES, and Blowfish ciphers, as used in SSH, have a birthday bound of approximately four billion blocks, which makes it easier for remote attackers to obtain cleartext data via a birthday attack against a long-duration encrypted session, aka a "Sweet32" attack

The RC4 algorithm, as used in the TLS protocol and SSL protocol, does not properly combine state data with key data during the initialization phase, which makes it easier for remote attackers to conduct plaintext-recovery attacks against the initial bytes of a stream by sniffing network traffic that occasionally relies on keys affected by the Invariance Weakness, and then using a brute-force approach involving LSB values, aka the "Bar Mitzvah" issue

The passwords used during an SSH session encrypted with RC4 can be recovered by an attacker who is able to capture and replay the session

Error handling in the SSH protocol; Client and Server, when using a block cipher algorithm in Cipher Block Chaining (CBC) mode, makes it easier for remote attackers to recover certain plaintext data from an arbitrary block of ciphertext in an SSH session via unknown vectors

The mm_newkeys_from_blob function in monitor_wrap.c, when an AES-GCM cipher is used, does not properly initialize memory for a MAC context data structure, which allows remote authenticated users to bypass intended ForceCommand and login-shell restrictions via packet data that provides a crafted callback address

Edit the /etc/ssh/sshd_config file add/modify the Ciphers line to contain a comma separated list of the site approved ciphers

Example:

Ciphers chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr

Any of the following tests or sub-groups may pass:
Ensure only strong Ciphers are used -- More
Script: sce/sshd_running_config_nm.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.13_Ensure_only_strong_Ciphers_are_used"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:40.028+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">https://nvd.nist.gov/vuln/detail/CVE-2016-2183</ident>
<ident system="http://cce.mitre.org">https://nvd.nist.gov/vuln/detail/CVE-2015-2808</ident>
<ident system="http://cce.mitre.org">https://www.kb.cert.org/vuls/id/565052</ident>
<ident system="http://cce.mitre.org">https://www.openssh.com/txt/cbc.adv</ident>
<ident system="http://cce.mitre.org">https://nvd.nist.gov/vuln/detail/CVE-2008-5161</ident>
<ident system="http://cce.mitre.org">https://nvd.nist.gov/vuln/detail/CVE-2013-4548</ident>
<ident system="http://cce.mitre.org">https://www.kb.cert.org/vuls/id/565052</ident>
<ident system="http://cce.mitre.org">https://www.openssh.com/txt/cbc.adv</ident>
<ident system="http://cce.mitre.org">SSHD_CONFIG(5)</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:40.028+07:00"
         start-time="2022-01-05T01:03:39.935+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure only strong Ciphers are used" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config_nm.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807016"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807016"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2794">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_807012_var"/>
<check-content-ref href="sce/sshd_running_config_nm.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807016"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:
  • CCE-IDv5: https://nvd.nist.gov/vuln/detail/CVE-2016-2183 -- More
    CCE Information
    CCE-IDv5: https://nvd.nist.gov/vuln/detail/CVE-2016-2183
    Published On:
    Last Modified On:
  • CCE-IDv5: https://nvd.nist.gov/vuln/detail/CVE-2015-2808 -- More
    CCE Information
    CCE-IDv5: https://nvd.nist.gov/vuln/detail/CVE-2015-2808
    Published On:
    Last Modified On:
  • CCE-IDv5: https://www.kb.cert.org/vuls/id/565052 -- More
    CCE Information
    CCE-IDv5: https://www.kb.cert.org/vuls/id/565052
    Published On:
    Last Modified On:
  • CCE-IDv5: https://www.openssh.com/txt/cbc.adv -- More
    CCE Information
    CCE-IDv5: https://www.openssh.com/txt/cbc.adv
    Published On:
    Last Modified On:
  • CCE-IDv5: https://nvd.nist.gov/vuln/detail/CVE-2008-5161 -- More
    CCE Information
    CCE-IDv5: https://nvd.nist.gov/vuln/detail/CVE-2008-5161
    Published On:
    Last Modified On:
  • CCE-IDv5: https://nvd.nist.gov/vuln/detail/CVE-2013-4548 -- More
    CCE Information
    CCE-IDv5: https://nvd.nist.gov/vuln/detail/CVE-2013-4548
    Published On:
    Last Modified On:
  • CCE-IDv5: https://www.kb.cert.org/vuls/id/565052 -- More
    CCE Information
    CCE-IDv5: https://www.kb.cert.org/vuls/id/565052
    Published On:
    Last Modified On:
  • CCE-IDv5: https://www.openssh.com/txt/cbc.adv -- More
    CCE Information
    CCE-IDv5: https://www.openssh.com/txt/cbc.adv
    Published On:
    Last Modified On:
  • CCE-IDv5: SSHD_CONFIG(5) -- More
    CCE Information
    CCE-IDv5: SSHD_CONFIG(5)
    Published On:
    Last Modified On:

Pass

5.2.14 Ensure only strong MAC algorithms are used

Description:

This variable limits the types of MAC algorithms that SSH can use during communication.

MD5 and 96-bit MAC algorithms are considered weak and have been shown to increase exploitability in SSH downgrade attacks. Weak algorithms continue to have a great deal of attention as a weak spot that can be exploited with expanded computing power. An attacker that breaks the algorithm could take advantage of a MiTM position to decrypt the SSH tunnel and capture credentials and information

Edit the /etc/ssh/sshd_config file and add/modify the MACs line to contain a comma separated list of the site approved MACs

Example:

MACs hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256

Any of the following tests or sub-groups may pass:
Ensure only strong MAC algorithms are used -- More
Script: sce/sshd_running_config_nm.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.14_Ensure_only_strong_MAC_algorithms_are_used"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:40.059+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/5"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident system="http://cce.mitre.org">More information on SSH downgrade attacks can be found here: http://www.mitls.org/pages/attacks/SLOTH</ident>
<ident system="http://cce.mitre.org">SSHD_CONFIG(5)</ident>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:40.059+07:00"
         start-time="2022-01-05T01:03:40.031+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure only strong MAC algorithms are used" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config_nm.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806939"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806939"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2795">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806933_var"/>
<check-content-ref href="sce/sshd_running_config_nm.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806939"/>
</check>
</complex-check>
</rule-result>

References:

Pass

5.2.15 Ensure only strong Key Exchange algorithms are used

Description:

Key exchange is any method in cryptography by which cryptographic keys are exchanged between two parties, allowing use of a cryptographic algorithm. If the sender and receiver wish to exchange encrypted messages, each must be equipped to encrypt messages to be sent and decrypt messages received

Key exchange methods that are considered weak should be removed. A key exchange method may be weak because too few bits are used, or the hashing algorithm is considered too weak. Using weak algorithms could expose connections to man-in-the-middle attacks

Edit the /etc/ssh/sshd_config file add/modify the KexAlgorithms line to contain a comma separated list of the site approved key exchange algorithms

Example:

KexAlgorithms curve25519-sha256,curve25519-sha256@libssh.org,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,ecdh-sha2-nistp521,ecdh-sha2-nistp384,ecdh-sha2-nistp256,diffie-hellman-group-exchange-sha256

Any of the following tests or sub-groups may pass:
Ensure only strong Key Exchange algorithms are used -- More
Script: sce/sshd_running_config_nm.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.15_Ensure_only_strong_Key_Exchange_algorithms_are_used"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:40.247+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:40.247+07:00"
         start-time="2022-01-05T01:03:40.163+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure only strong Key Exchange algorithms are used" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config_nm.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807068"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807068"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2796">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_807065_var"/>
<check-content-ref href="sce/sshd_running_config_nm.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807068"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.16 Ensure SSH Idle Timeout Interval is configured

Description:

The two options ClientAliveInterval and ClientAliveCountMax control the timeout of ssh sessions. When the ClientAliveInterval variable is set, ssh sessions that have no activity for the specified length of time are terminated. When the ClientAliveCountMax variable is set, sshd will send client alive messages at every ClientAliveInterval interval. When the number of consecutive client alive messages are sent with no response from the client, the ssh session is terminated. For example, if the ClientAliveInterval is set to 15 seconds and the ClientAliveCountMax is set to 3, the client ssh session will be terminated after 45 seconds of idle time.

Having no timeout value associated with a connection could allow an unauthorized user access to another user's ssh session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening..

While the recommended setting is 300 seconds (5 minutes), set this timeout value based on site policy. The recommended setting for ClientAliveCountMax is 0. In this case, the client session will be terminated after 5 minutes of idle time and no keepalive messages will be sent.

Edit the /etc/ssh/sshd_config file to set the parameters according to site policy:

ClientAliveInterval 300

ClientAliveCountMax 0

Any of the following tests or sub-groups may pass:
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist
All of the following tests or sub-groups must pass:
Ensure SSH Idle Timeout Interval is configured -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure SSH Idle Timeout Interval is configured -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.16_Ensure_SSH_Idle_Timeout_Interval_is_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:40.382+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/11"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:40.383+07:00"
         start-time="2022-01-05T01:03:40.304+07:00">
<cis:or>
 <cis:and>
    <cis:evidence_test comment="Ensure SSH Idle Timeout Interval is configured" result="unknown">
       <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
          <cis:environment_variables>
             <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
             <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
             <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
             <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
             <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
             <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
          </cis:environment_variables>
       </cis:evidence_sce>
    </cis:evidence_test>
    <cis:evidence_test comment="Ensure SSH Idle Timeout Interval is configured" result="unknown">
       <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
          <cis:environment_variables>
             <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
             <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
             <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
             <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
             <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
             <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
             <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
          </cis:environment_variables>
       </cis:evidence_sce>
    </cis:evidence_test>
 </cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806959"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806959"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2797">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<xccdf:complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
 <check-import import-name="stdout"/>
 <check-export export-name="XCCDF_VALUE_REGEX"
               value-id="xccdf_org.cisecurity.benchmarks_value_806948_var"/>
 <check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://open-scap.org/page/SCE">
 <check-import import-name="stdout"/>
 <check-export export-name="XCCDF_VALUE_REGEX"
               value-id="xccdf_org.cisecurity.benchmarks_value_806953_var"/>
 <check-content-ref href="sce/sshd_running_config.sh"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806959"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.17 Ensure SSH LoginGraceTime is set to one minute or less

Description:

The LoginGraceTime parameter specifies the time allowed for successful authentication to the SSH server. The longer the Grace period is the more open unauthenticated connections can exist. Like other session controls in this session the Grace Period should be limited to appropriate organizational limits to ensure the service is available for needed access.

Setting the LoginGraceTime parameter to a low number will minimize the risk of successful brute force attacks to the SSH server. It will also limit the number of concurrent unauthenticated connections While the recommended setting is 60 seconds (1 Minute), set the number based on site policy.

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

LoginGraceTime 60

Any of the following tests or sub-groups may pass:
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist
Ensure SSH LoginGraceTime is set to one minute or less -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.17_Ensure_SSH_LoginGraceTime_is_set_to_one_minute_or_less"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:40.585+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:40.586+07:00"
         start-time="2022-01-05T01:03:40.398+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806975"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806975"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2798">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test comment="Ensure SSH LoginGraceTime is set to one minute or less"
                    result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806967_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806975"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.18 Ensure SSH access is limited

Description:

There are several options available to limit which users and group can access the system via SSH. It is recommended that at least one of the following options be leveraged:

AllowUsers

The AllowUsers variable gives the system administrator the option of allowing specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by only allowing the allowed users to log in from a particular host, the entry can be specified in the form of user@host.

AllowGroups

The AllowGroups variable gives the system administrator the option of allowing specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable.

DenyUsers

The DenyUsers variable gives the system administrator the option of denying specific users to ssh into the system. The list consists of space separated user names. Numeric user IDs are not recognized with this variable. If a system administrator wants to restrict user access further by specifically denying a user's access from a particular host, the entry can be specified in the form of user@host.

DenyGroups

The DenyGroups variable gives the system administrator the option of denying specific groups of users to ssh into the system. The list consists of space separated group names. Numeric group IDs are not recognized with this variable.

Restricting which users can remotely access the system via SSH will help ensure that only authorized users access the system.

Edit the /etc/ssh/sshd_config file to set one or more of the parameter as follows:

AllowUsers <userlist> AllowGroups <grouplist> DenyUsers <userlist> DenyGroups <grouplist>

Any of the following tests or sub-groups may pass:
Ensure SSH access is limited -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.18_Ensure_SSH_access_is_limited"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:40.713+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/3"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:40.713+07:00"
         start-time="2022-01-05T01:03:40.643+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure SSH access is limited" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806989"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806989"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2799">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806983_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806989"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.19 Ensure SSH warning banner is configured

Description:

The Banner parameter specifies a file whose contents must be sent to the remote user before authentication is permitted. By default, no banner is displayed.

Banners are used to warn connecting users of the particular site's policy regarding connection. Presenting a warning message prior to the normal user login may assist the prosecution of trespassers on the computer system.

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

Banner /etc/issue.net

Any of the following tests or sub-groups may pass:
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist
Ensure SSH warning banner is configured -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.19_Ensure_SSH_warning_banner_is_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:40.745+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:40.745+07:00"
         start-time="2022-01-05T01:03:40.716+07:00">
<cis:or>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807001"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807001"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2800">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test comment="Ensure SSH warning banner is configured" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_806997_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807001"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.20 Ensure SSH PAM is enabled

Description:

UsePAM Enables the Pluggable Authentication Module interface. If set to “yes” this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types

When usePAM is set to yes, PAM runs through account and session types properly. This is important if you want to restrict access to services based off of IP, time or other factors of the account. Additionally, you can make sure users inherit certain environment variables on login or disallow access to the server

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

UsePAM yes

Impact:

If UsePAM is enabled, you will not be able to run sshd(8) as a non-root user.

Any of the following tests or sub-groups may pass:
Ensure SSH PAM is enabled -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.20_Ensure_SSH_PAM_is_enabled"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:41.060+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:41.060+07:00"
         start-time="2022-01-05T01:03:40.976+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure SSH PAM is enabled" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807078"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807078"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2803">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_807075_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807078"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.22 Ensure SSH MaxStartups is configured

Description:

The MaxStartups parameter specifies the maximum number of concurrent unauthenticated connections to the SSH daemon.

To protect a system from denial of service due to a large number of pending authentication connection attempts, use the rate limiting function of MaxStartups to protect availability of sshd logins and prevent overwhelming the daemon.

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

maxstartups 10:30:60

Any of the following tests or sub-groups may pass:
Ensure SSH MaxStartups is configured -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.22_Ensure_SSH_MaxStartups_is_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:41.211+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:41.211+07:00"
         start-time="2022-01-05T01:03:41.119+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure SSH MaxStartups is configured" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807102"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807102"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2804">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_807098_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807102"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.2.23 Ensure SSH MaxSessions is set to 4 or less

Description:

The MaxSessions parameter specifies the maximum number of open sessions permitted from a given connection.

To protect a system from denial of service due to a large number of concurrent sessions, use the rate limiting function of MaxSessions to protect availability of sshd logins and prevent overwhelming the daemon.

Edit the /etc/ssh/sshd_config file to set the parameter as follows:

MaxSessions 4

Any of the following tests or sub-groups may pass:
Ensure SSH MaxSessions is set to 4 or less -- More
Script: sce/sshd_running_config.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Ensure package name equals 'openssh-server' is not installed -- More
CIS-CAT did not expect to collect any matching dpkg Packages, and found 0 items.
Package Name: openssh-server does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.2.23_Ensure_SSH_MaxSessions_is_set_to_4_or_less"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:41.302+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:41.303+07:00"
         start-time="2022-01-05T01:03:41.214+07:00">
<cis:or>
 <cis:evidence_test comment="Ensure SSH MaxSessions is set to 4 or less" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/sshd_running_config.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure package name equals 'openssh-server' is not installed"
                    negated="false"
                    ns="linux"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807114"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807114"
                    type="dpkginfo_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2805">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="name" value="openssh-server"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:or>
</cis:evidence>
</metadata>
<complex-check operator="OR">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-export export-name="XCCDF_VALUE_REGEX"
            value-id="xccdf_org.cisecurity.benchmarks_value_807109_var"/>
<check-content-ref href="sce/sshd_running_config.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807114"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

5.3 Configure PAM

PAM (Pluggable Authentication Modules) is a service that implements modular authentication modules on UNIX systems. PAM is implemented as a set of shared objects that are loaded and executed when a program needs to authenticate a user. Files for PAM are typically located in the /etc/pam.d directory. PAM must be carefully configured to secure system authentication. While this section covers some of PAM, please consult other PAM resources to fully understand the configuration capabilities.

Fail

5.3.1 Ensure password creation requirements are configured

Description:

The pam_pwquality.so module checks the strength of passwords. It performs checks such as making sure a password is not a dictionary word, it is a certain length, contains a mix of characters (e.g. alphabet, numeric, other) and more. The following are definitions of the pam_pwquality.so options.

The following options are set in the /etc/security/pwquality.conf file:

Password Length:

  • minlen = 14 - password must be 14 characters or more

Password complexity:

  • minclass = 4 - The minimum number of required classes of characters for the new password (digits, uppercase, lowercase, others)

OR

  • dcredit = -1 - provide at least one digit
  • ucredit = -1 - provide at least one uppercase character
  • ocredit = -1 - provide at least one special character
  • lcredit = -1 - provide at least one lowercase character

The following is st in the /etc/pam.d/common-password file

  • retry=3 - Allow 3 tries before sending back a failure.

The settings shown above are one possible policy. Alter these values to conform to your own organization's password policies.

Strong passwords protect systems from being hacked through brute force methods.

Run the following command to install the pam_pwquality module:

apt install libpam-pwquality

Edit the file /etc/security/pwquality.conf and add or modify the following line for password length to conform to site policy

minlen = 14

Edit the file /etc/security/pwquality.conf and add or modify the following line for password complexity to conform to site policy

minclass = 4

OR

dcredit = -1
ucredit = -1
ocredit = -1
lcredit = -1

Edit the /etc/pam.d/common-password file to include the appropriate options for pam_pwquality.so and to conform to site policy:

password requisite pam_pwquality.so retry=3

All of the following tests or sub-groups must pass:
Ensure at least one file named /etc/security/pwquality.conf exists and matches pattern ^\s*minlen\s*=\s*(1[4-9]|[2-9][0-9]|[1-9][0-9][0-9])(\s+#.*)*$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/security/pwquality.conf does not exist
Pattern: ^\s*minlen\s*=\s*(1[4-9]|[2-9][0-9]|[1-9][0-9][0-9])(\s+#.*)*$
Match Text: No match found
Ensure at least one file named /etc/pam.d/common-password exists and matches pattern ^\s*password\s+(requisite|required)\s+pam_pwquality\.so\s+(\S+\s+)*retry=[1-3]\s*(\s+\S+\s*)*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/pam.d/common-password does not exist
Pattern: ^\s*password\s+(requisite|required)\s+pam_pwquality\.so\s+(\S+\s+)*retry=[1-3]\s*(\s+\S+\s*)*(\s+#.*)?$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.3.1_Ensure_password_creation_requirements_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:42.333+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:42.333+07:00"
         start-time="2022-01-05T01:03:42.318+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/security/pwquality.conf exists and matches pattern ^\s*minlen\s*=\s*(1[4-9]|[2-9][0-9]|[1-9][0-9][0-9])(\s+#.*)*$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806783"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806783"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2816">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/security/pwquality.conf"/>
             <cis:evidence_item_pk_field name="path" value="/etc/security"/>
             <cis:evidence_item_pk_field name="filename" value="pwquality.conf"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*minlen\s*=\s*(1[4-9]|[2-9][0-9]|[1-9][0-9][0-9])(\s+#.*)*$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/pam.d/common-password exists and matches pattern ^\s*password\s+(requisite|required)\s+pam_pwquality\.so\s+(\S+\s+)*retry=[1-3]\s*(\s+\S+\s*)*(\s+#.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806788"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806788"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2817">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/pam.d/common-password"/>
             <cis:evidence_item_pk_field name="path" value="/etc/pam.d"/>
             <cis:evidence_item_pk_field name="filename" value="common-password"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*password\s+(requisite|required)\s+pam_pwquality\.so\s+(\S+\s+)*retry=[1-3]\s*(\s+\S+\s*)*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806783"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806788"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.3.2 Ensure lockout for failed password attempts is configured

Description:

Lock out users after n unsuccessful consecutive login attempts. The first sets of changes are made to the PAM configuration files. The second set of changes are applied to the program specific PAM configuration file. The second set of changes must be applied to each program that will lock out users. Check the documentation for each secondary program for instructions on how to configure them to work with PAM.

  • deny= n - n represents the number of failed attempts before the account is locked
  • unlock_time= n - n represents the number of seconds before the account is unlocked
  • audit - Will log the user name into the system log if the user is not found.
  • silent - Don't print informative messages.

Set the lockout number and unlock time in accordance with local site policy.

Locking out user IDs after n unsuccessful consecutive login attempts mitigates brute force password attacks against your systems.

Edit the /etc/pam.d/common-auth file and add the auth line below:

auth required pam_tally2.so onerr=fail audit silent deny=5 unlock_time=900

Edit the /etc/pam.d/common-account file and add the account lines bellow:

account requisite pam_deny.so
account required pam_tally.so

Note: If a user has been locked out because they have reached the maximum consecutive failure count defined by deny= in the pam_tally2.so module, the user can be unlocked by issuing the command /sbin/pam_tally2 -u <username> --reset . This command sets the failed count to 0, effectively unlocking the user.

All of the following tests or sub-groups must pass:
Ensure at least one file named /etc/pam.d/common-account exists and matches pattern ^\s*account\s+required\s+(\S+\s+)*pam_tally2\.so\s*(\s+\S+\s*)*(\s+.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/pam.d/common-account does not exist
Pattern: ^\s*account\s+required\s+(\S+\s+)*pam_tally2\.so\s*(\s+\S+\s*)*(\s+.*)?$
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensure /etc/pam.d//common-auth contents Pattern Match deny=[1-5] (string) -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/pam.d/common-auth does not exist
Pattern: ^\s*auth\s+required\s+pam_tally2.so\s*.*$
Match Text: No match found
Ensure /etc/pam.d//common-account contents Pattern Match pam_deny\.so (string) -- More
File: /etc/pam.d/common-account
Pattern: ^\s*account\s+requisite\s*.*$
Match Text: account requisite pam_deny.so
CIS-CAT Expected... CIS-CAT Collected...
the collected item's text matches the regular expression pam_deny\.so account requisite pam_deny.so

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.3.2_Ensure_lockout_for_failed_password_attempts_is_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:42.417+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/7"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:42.417+07:00"
         start-time="2022-01-05T01:03:42.411+07:00">
<cis:and>
 <cis:and>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure /etc/pam.d//common-auth contents Pattern Match deny=[1-5] (string)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:810460"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:810460"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2818">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/pam.d/common-auth"/>
                <cis:evidence_item_pk_field name="path" value="/etc/pam.d"/>
                <cis:evidence_item_pk_field name="filename" value="common-auth"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*auth\s+required\s+pam_tally2.so\s*.*$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure /etc/pam.d//common-account contents Pattern Match pam_deny\.so (string)"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:810461"
                       result="true"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:810461"
                       type="textfilecontent54_test">
       <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:810461">
          <cis:evidence_item itemref="2819">
             <cis:evidence_item_pk status="exists">
                <cis:evidence_item_pk_field name="filepath" value="/etc/pam.d/common-account"/>
                <cis:evidence_item_pk_field name="path" value="/etc/pam.d"/>
                <cis:evidence_item_pk_field name="filename" value="common-account"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*account\s+requisite\s*.*$"/>
                <cis:evidence_item_pk_field name="instance" value="1"/>
                <cis:evidence_item_pk_field name="text" value="account requisite   pam_deny.so"/>
             </cis:evidence_item_pk>
             <cis:evidence_field cv="account requisite   pam_deny.so" dt="string" ev="pam_deny\.so" name="text"
                                 op="pattern match"
                                 result="true"/>
          </cis:evidence_item>
       </cis:evidence_state>
    </cis:evidence_test>
 </cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/pam.d/common-account exists and matches pattern ^\s*account\s+required\s+(\S+\s+)*pam_tally2\.so\s*(\s+\S+\s*)*(\s+.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:810462"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:810462"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2820">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/pam.d/common-account"/>
             <cis:evidence_item_pk_field name="path" value="/etc/pam.d"/>
             <cis:evidence_item_pk_field name="filename" value="common-account"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*account\s+required\s+(\S+\s+)*pam_tally2\.so\s*(\s+\S+\s*)*(\s+.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<xccdf:complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:810460"
               value-id="xccdf_org.cisecurity.benchmarks_value_8104601_var"/>
 <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:8104602"
               value-id="xccdf_org.cisecurity.benchmarks_value_8104602_var"/>
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:810460"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:810461"
               value-id="xccdf_org.cisecurity.benchmarks_value_8104611_var"/>
 <check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:8104612"
               value-id="xccdf_org.cisecurity.benchmarks_value_8104612_var"/>
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:810461"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:810462"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.3.3 Ensure password reuse is limited

Description:

The /etc/security/opasswd file stores the users' old passwords and can be checked to ensure that users are not recycling recent passwords.

Forcing users not to reuse their past 5 passwords make it less likely that an attacker will be able to guess the password.

Note that these change only apply to accounts configured on the local system.

Edit the /etc/pam.d/common-password file to include the remember option and conform to site policy as shown:

password required pam_pwhistory.so remember=5

Ensure at least one file named /etc/pam.d/common-password exists and matches pattern ^\s*password\s+required\s+pam_pwhistory\.so\s+(\S+\s+)*remember=([56789]|[1-9][0-9]+)\s*(\s+\S+\s*)*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/pam.d/common-password does not exist
Pattern: ^\s*password\s+required\s+pam_pwhistory\.so\s+(\S+\s+)*remember=([56789]|[1-9][0-9]+)\s*(\s+\S+\s*)*(\s+#.*)?$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.3.3_Ensure_password_reuse_is_limited"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:42.421+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:42.422+07:00"
         start-time="2022-01-05T01:03:42.419+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/pam.d/common-password exists and matches pattern ^\s*password\s+required\s+pam_pwhistory\.so\s+(\S+\s+)*remember=([56789]|[1-9][0-9]+)\s*(\s+\S+\s*)*(\s+#.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806805"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806805"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2821">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/pam.d/common-password"/>
             <cis:evidence_item_pk_field name="path" value="/etc/pam.d"/>
             <cis:evidence_item_pk_field name="filename" value="common-password"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*password\s+required\s+pam_pwhistory\.so\s+(\S+\s+)*remember=([56789]|[1-9][0-9]+)\s*(\s+\S+\s*)*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806805"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.3.4 Ensure password hashing algorithm is SHA-512

Description:

The commands below change password encryption from md5 to sha512 (a much stronger hashing algorithm). All existing accounts will need to perform a password change to upgrade the stored hashes to the new algorithm.

The SHA-512 algorithm provides much stronger hashing than MD5, thus providing additional protection to the system by increasing the level of effort for an attacker to successfully determine passwords.

Note that these change only apply to accounts configured on the local system.

Edit the /etc/pam.d/common-password file to include the sha512 option for pam_unix.so as shown:

password [success=1 default=ignore] pam_unix.so sha512

Ensure at least one file named /etc/pam.d/common-password exists and matches pattern ^\s*password\s+(\S+\s+)+pam_unix\.so\s+(\S+\s+)*sha512\s*(\S+\s*)*(\s+#.*)?$ -- More
CIS-CAT expected at least 1 matching text file content item to be collected, and found 1 item.
File: /etc/pam.d/common-password exists
Pattern: ^\s*password\s+(\S+\s+)+pam_unix\.so\s+(\S+\s+)*sha512\s*(\S+\s*)*(\s+#.*)?$
Match Text: password [success=1 default=ignore] pam_unix.so obscure sha512 # here's the fallback if no module succeeds password requisite pam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around password required pam_permit.so # and here are more per-package modules (the "Additional" block) password optional pam_gnome_keyring.so # end of pam-auth-update config

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.3.4_Ensure_password_hashing_algorithm_is_SHA-512"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:42.427+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:42.428+07:00"
         start-time="2022-01-05T01:03:42.423+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/pam.d/common-password exists and matches pattern ^\s*password\s+(\S+\s+)+pam_unix\.so\s+(\S+\s+)*sha512\s*(\S+\s*)*(\s+#.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806811"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806811"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2822">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/pam.d/common-password"/>
             <cis:evidence_item_pk_field name="path" value="/etc/pam.d"/>
             <cis:evidence_item_pk_field name="filename" value="common-password"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*password\s+(\S+\s+)+pam_unix\.so\s+(\S+\s+)*sha512\s*(\S+\s*)*(\s+#.*)?$"/>
             <cis:evidence_item_pk_field name="instance" value="1"/>
             <cis:evidence_item_pk_field name="text"
                                         value="password [success=1 default=ignore] pam_unix.so obscure sha512 # here's the fallback if no module succeeds password requisite   pam_deny.so # prime the stack with a positive return value if there isn't one already; # this avoids us returning an error just because nothing sets a success code # since the modules above will each just jump around password required   pam_permit.so # and here are more per-package modules (the &#34;Additional&#34; block) password optional pam_gnome_keyring.so  # end of pam-auth-update config "/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806811"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

5.4 User Accounts and Environment

This section provides guidance on setting up secure defaults for system and user accounts and their environment.

5.4.1 Set Shadow Password Suite Parameters

While a majority of the password control parameters have been moved to PAM, some parameters are still available through the shadow password suite. Any changes made to /etc/login.defs will only be applied if the usermod command is used. If user IDs are added a different way, use the chage command to effect changes to individual user IDs.

Fail

5.4.1.1 Ensure password expiration is 365 days or less

Description:

The PASS_MAX_DAYS parameter in /etc/login.defs allows an administrator to force passwords to expire once they reach a defined age. It is recommended that the PASS_MAX_DAYS parameter be set to less than or equal to 365 days.

The window of opportunity for an attacker to leverage compromised credentials or successfully compromise credentials via an online brute force attack is limited by the age of the password. Therefore, reducing the maximum age of a password also reduces an attacker's window of opportunity.

Set the PASS_MAX_DAYS parameter to conform to site policy in /etc/login.defs :

PASS_MAX_DAYS 365

Modify user parameters for all users with a password set to match:

# chage --maxdays 365 <user>

All of the following tests or sub-groups must pass:
Ensure at least one file named /etc/login.defs exists and matches pattern ^\s*PASS_MAX_DAYS\s+(36[0-5]|3[0-5][0-9]|[1-2][0-9][0-9]|[1-9][0-9]?)\s*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/login.defs does not exist
Pattern: ^\s*PASS_MAX_DAYS\s+(36[0-5]|3[0-5][0-9]|[1-2][0-9][0-9]|[1-9][0-9]?)\s*(\s+#.*)?$
Match Text: No match found
Linux Custom Object "Ensure no users with a Password have password expiration over 365 days" -- Less
Check: None May Pass
User: root
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] !
the Password Life (days) to be greater than 365 99999
User: daemon
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: bin
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: sys
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: sync
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: games
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: man
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: lp
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: mail
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: news
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: uucp
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: proxy
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: www-data
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: backup
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: list
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: irc
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: gnats
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: nobody
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: systemd-network
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: systemd-resolve
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: syslog
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: messagebus
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: _apt
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: uuidd
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: avahi-autoipd
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: usbmux
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: dnsmasq
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: rtkit
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: speech-dispatcher
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] !
the Password Life (days) to be greater than 365 99999
User: whoopsie
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: kernoops
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: saned
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: pulse
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: avahi
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: colord
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: hplip
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: geoclue
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: gnome-initial-setup
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: gdm
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999
User: sanh
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] $6$Suu88l4t$zESmGFeyBWwqLWUkCTg0CQeZgNJ7AI1XvoikwpQWtYbi0v62y4itEjIt9IJEw0hGI4b/qKgyeoYbkoIl5L6p50
the Password Life (days) to be greater than 365 99999
User: cups-pk-helper
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Password Life (days) to be greater than 365 99999

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.4.1.1_Ensure_password_expiration_is_365_days_or_less"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:42.463+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:42.464+07:00"
         start-time="2022-01-05T01:03:42.431+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/login.defs exists and matches pattern ^\s*PASS_MAX_DAYS\s+(36[0-5]|3[0-5][0-9]|[1-2][0-9][0-9]|[1-9][0-9]?)\s*(\s+#.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806965"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806965"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2823">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/login.defs"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="login.defs"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*PASS_MAX_DAYS\s+(36[0-5]|3[0-5][0-9]|[1-2][0-9][0-9]|[1-9][0-9]?)\s*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="none satisfy" check_existence="any_exist"
                    comment="Linux Custom Object &#34;Ensure no users with a Password have password expiration over 365 days&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806970"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806970"
                    type="shadow_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806970">
       <cis:evidence_item itemref="1099">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="root"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="!" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1100">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="daemon"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1101">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="bin"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1102">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sys"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1103">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sync"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1104">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="games"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1105">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="man"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1106">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="lp"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1107">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="mail"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1108">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="news"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1109">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="uucp"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1110">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="proxy"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1111">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="www-data"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1112">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="backup"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1113">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="list"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1114">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="irc"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1115">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gnats"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1116">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="nobody"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1117">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="systemd-network"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1118">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="systemd-resolve"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1119">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="syslog"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1120">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="messagebus"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1121">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="_apt"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1122">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="uuidd"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1123">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="avahi-autoipd"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1124">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="usbmux"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1125">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="dnsmasq"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1126">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="rtkit"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1127">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="speech-dispatcher"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="!" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1128">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="whoopsie"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1129">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="kernoops"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1130">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="saned"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1131">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="pulse"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1132">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="avahi"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1133">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="colord"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1134">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="hplip"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1135">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="geoclue"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1136">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gnome-initial-setup"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1137">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gdm"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1138">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sanh"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="$6$Suu88l4t$zESmGFeyBWwqLWUkCTg0CQeZgNJ7AI1XvoikwpQWtYbi0v62y4itEjIt9IJEw0hGI4b/qKgyeoYbkoIl5L6p50"
                              dt="string"
                              ev="^[^!*]"
                              name="password"
                              op="pattern match"
                              result="true"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1139">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="cups-pk-helper"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="99999" dt="int" ev="365" name="chg_req" op="greater than" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806965"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806970"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.4.1.2 Ensure minimum days between password changes is configured

Description:

The PASS_MIN_DAYS parameter in /etc/login.defs allows an administrator to prevent users from changing their password until a minimum number of days have passed since the last time the user changed their password. It is recommended that PASS_MIN_DAYS parameter be set to 1 or more days.

By restricting the frequency of password changes, an administrator can prevent users from repeatedly changing their password in an attempt to circumvent password reuse controls.

Set the PASS_MIN_DAYS parameter to 1 in /etc/login.defs :

PASS_MIN_DAYS 1

Modify user parameters for all users with a password set to match:

# chage --mindays 1 <user>

All of the following tests or sub-groups must pass:
Ensure no file named /etc/shadow exists and matches pattern ^\S+:[^\!\*:]*:[^:]*:(0|\-1):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*\s*$ -- Less
CIS-CAT did not expect to collect any matching text file content items, and found 1 item.
File: /etc/shadow exists
Pattern: ^\S+:[^\!\*:]*:[^:]*:(0|\-1):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*\s*$
Match Text: sanh:$6$Suu88l4t$zESmGFeyBWwqLWUkCTg0CQeZgNJ7AI1XvoikwpQWtYbi0v62y4itEjIt9IJEw0hGI4b/qKgyeoYbkoIl5L6p50:18996:0:99999:7:::
Ensure at least one file named /etc/login.defs exists and matches pattern ^\s*PASS_MIN_DAYS\s+([1-9]|[1-9][0-9]+)\s*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/login.defs does not exist
Pattern: ^\s*PASS_MIN_DAYS\s+([1-9]|[1-9][0-9]+)\s*(\s+#.*)?$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.4.1.2_Ensure_minimum_days_between_password_changes_is__configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:42.543+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc6:controlURI="http://cisecurity.org/20-cc/v6.1/control/16"
system="http://cisecurity.org/20-cc/v6.1"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:42.543+07:00"
         start-time="2022-01-05T01:03:42.538+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensure no file named /etc/shadow exists and matches pattern ^\S+:[^\!\*:]*:[^:]*:(0|\-1):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*\s*$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806985"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806985"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2824">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/shadow"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="shadow"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\S+:[^\!\*:]*:[^:]*:(0|\-1):[^:]*:[^:]*:[^:]*:[^:]*:[^:]*\s*$"/>
             <cis:evidence_item_pk_field name="instance" value="1"/>
             <cis:evidence_item_pk_field name="text"
                                         value="sanh:$6$Suu88l4t$zESmGFeyBWwqLWUkCTg0CQeZgNJ7AI1XvoikwpQWtYbi0v62y4itEjIt9IJEw0hGI4b/qKgyeoYbkoIl5L6p50:18996:0:99999:7:::"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/login.defs exists and matches pattern ^\s*PASS_MIN_DAYS\s+([1-9]|[1-9][0-9]+)\s*(\s+#.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806979"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806979"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2825">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/login.defs"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="login.defs"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*PASS_MIN_DAYS\s+([1-9]|[1-9][0-9]+)\s*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806979"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806985"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Critical Controls:

  • Control 16: Account Monitoring and Control: -- More
    Critical Control Information
    Control: Actively manage the life cycle of system and application accounts – their creation, use, dormancy, deletion – in order to minimize opportunities for attackers to leverage them.

Pass

5.4.1.3 Ensure password expiration warning days is 7 or more

Description:

The PASS_WARN_AGE parameter in /etc/login.defs allows an administrator to notify users that their password will expire in a defined number of days. It is recommended that the PASS_WARN_AGE parameter be set to 7 or more days.

Providing an advance warning that a password will be expiring gives users time to think of a secure password. Users caught unaware may choose a simple password or write it down where it may be discovered.

Set the PASS_WARN_AGE parameter to 7 in /etc/login.defs :

PASS_WARN_AGE 7

Modify user parameters for all users with a password set to match:

# chage --warndays 7 <user>

All of the following tests or sub-groups must pass:
Ensure at least one file named /etc/login.defs exists and matches pattern ^\s*PASS_WARN_AGE\s+([789]|[1-9][0-9]+)\s*(\s+#.*)?$ -- More
CIS-CAT expected at least 1 matching text file content item to be collected, and found 1 item.
File: /etc/login.defs exists
Pattern: ^\s*PASS_WARN_AGE\s+([789]|[1-9][0-9]+)\s*(\s+#.*)?$
Match Text: PASS_WARN_AGE 7 #
Linux Custom Object "Ensure no users with a Password have password expiration warning under 7 days" -- More
Check: None May Pass
User: root
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] !
the Expiration Warning to be less than 7 7
User: daemon
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: bin
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: sys
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: sync
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: games
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: man
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: lp
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: mail
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: news
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: uucp
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: proxy
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: www-data
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: backup
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: list
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: irc
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: gnats
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: nobody
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: systemd-network
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: systemd-resolve
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: syslog
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: messagebus
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: _apt
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: uuidd
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: avahi-autoipd
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: usbmux
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: dnsmasq
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: rtkit
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: speech-dispatcher
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] !
the Expiration Warning to be less than 7 7
User: whoopsie
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: kernoops
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: saned
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: pulse
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: avahi
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: colord
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: hplip
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: geoclue
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: gnome-initial-setup
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: gdm
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7
User: sanh
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] $6$Suu88l4t$zESmGFeyBWwqLWUkCTg0CQeZgNJ7AI1XvoikwpQWtYbi0v62y4itEjIt9IJEw0hGI4b/qKgyeoYbkoIl5L6p50
the Expiration Warning to be less than 7 7
User: cups-pk-helper
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Expiration Warning to be less than 7 7

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.4.1.3_Ensure_password_expiration_warning_days_is_7_or_more"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:42.655+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:42.655+07:00"
         start-time="2022-01-05T01:03:42.624+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/login.defs exists and matches pattern ^\s*PASS_WARN_AGE\s+([789]|[1-9][0-9]+)\s*(\s+#.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806992"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806992"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2826">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/login.defs"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="login.defs"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*PASS_WARN_AGE\s+([789]|[1-9][0-9]+)\s*(\s+#.*)?$"/>
             <cis:evidence_item_pk_field name="instance" value="1"/>
             <cis:evidence_item_pk_field name="text" value="PASS_WARN_AGE 7  #"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
 <cis:evidence_test check="none satisfy" check_existence="any_exist"
                    comment="Linux Custom Object &#34;Ensure no users with a Password have password expiration warning under 7 days&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807000"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807000"
                    type="shadow_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807000">
       <cis:evidence_item itemref="1099">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="root"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="!" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1100">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="daemon"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1101">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="bin"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1102">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sys"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1103">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sync"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1104">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="games"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1105">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="man"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1106">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="lp"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1107">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="mail"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1108">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="news"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1109">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="uucp"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1110">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="proxy"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1111">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="www-data"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1112">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="backup"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1113">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="list"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1114">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="irc"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1115">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gnats"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1116">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="nobody"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1117">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="systemd-network"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1118">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="systemd-resolve"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1119">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="syslog"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1120">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="messagebus"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1121">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="_apt"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1122">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="uuidd"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1123">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="avahi-autoipd"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1124">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="usbmux"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1125">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="dnsmasq"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1126">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="rtkit"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1127">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="speech-dispatcher"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="!" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1128">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="whoopsie"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1129">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="kernoops"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1130">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="saned"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1131">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="pulse"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1132">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="avahi"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1133">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="colord"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1134">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="hplip"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1135">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="geoclue"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1136">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gnome-initial-setup"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1137">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gdm"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1138">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sanh"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="$6$Suu88l4t$zESmGFeyBWwqLWUkCTg0CQeZgNJ7AI1XvoikwpQWtYbi0v62y4itEjIt9IJEw0hGI4b/qKgyeoYbkoIl5L6p50"
                              dt="string"
                              ev="^[^!*]"
                              name="password"
                              op="pattern match"
                              result="true"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1139">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="cups-pk-helper"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="7" dt="int" ev="7" name="exp_warn" op="less than" result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806992"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807000"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.4.1.4 Ensure inactive password lock is 30 days or less

Description:

User accounts that have been inactive for over a given period of time can be automatically disabled. It is recommended that accounts that are inactive for 30 days after password expiration be disabled.

Inactive accounts pose a threat to system security since the users are not logging in to notice failed login attempts or other anomalies.

Run the following command to set the default password inactivity period to 30 days:

# useradd -D -f 30

Modify user parameters for all users with a password set to match:

# chage --inactive 30 <user>

All of the following tests or sub-groups must pass:
Linux Custom Object "Ensure no users with a Password have password inactivation over 30 days" -- More
Check: None May Pass
User: root
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] !
the Inactivity Days to be less than 7
User: daemon
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: bin
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: sys
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: sync
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: games
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: man
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: lp
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: mail
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: news
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: uucp
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: proxy
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: www-data
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: backup
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: list
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: irc
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: gnats
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: nobody
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: systemd-network
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: systemd-resolve
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: syslog
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: messagebus
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: _apt
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: uuidd
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: avahi-autoipd
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: usbmux
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: dnsmasq
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: rtkit
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: speech-dispatcher
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] !
the Inactivity Days to be less than 7
User: whoopsie
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: kernoops
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: saned
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: pulse
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: avahi
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: colord
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: hplip
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: geoclue
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: gnome-initial-setup
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: gdm
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
User: sanh
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] $6$Suu88l4t$zESmGFeyBWwqLWUkCTg0CQeZgNJ7AI1XvoikwpQWtYbi0v62y4itEjIt9IJEw0hGI4b/qKgyeoYbkoIl5L6p50
the Inactivity Days to be less than 7
User: cups-pk-helper
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression ^[^!*] *
the Inactivity Days to be less than 7
Ensure at least one file named /etc/default/useradd exists and matches pattern ^\s*INACTIVE\s*=\s*(30|[1-2][0-9]|[1-9])\s*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/default/useradd does not exist
Pattern: ^\s*INACTIVE\s*=\s*(30|[1-2][0-9]|[1-9])\s*(\s+#.*)?$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.4.1.4_Ensure_inactive_password_lock_is_30_days_or_less"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:42.788+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:42.789+07:00"
         start-time="2022-01-05T01:03:42.767+07:00">
<cis:and>
 <cis:evidence_test check="none satisfy" check_existence="any_exist"
                    comment="Linux Custom Object &#34;Ensure no users with a Password have password inactivation over 30 days&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807013"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807013"
                    type="shadow_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807013">
       <cis:evidence_item itemref="1099">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="root"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="!" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1100">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="daemon"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1101">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="bin"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1102">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sys"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1103">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sync"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1104">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="games"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1105">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="man"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1106">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="lp"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1107">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="mail"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1108">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="news"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1109">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="uucp"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1110">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="proxy"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1111">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="www-data"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1112">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="backup"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1113">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="list"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1114">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="irc"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1115">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gnats"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1116">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="nobody"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1117">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="systemd-network"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1118">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="systemd-resolve"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1119">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="syslog"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1120">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="messagebus"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1121">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="_apt"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1122">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="uuidd"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1123">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="avahi-autoipd"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1124">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="usbmux"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1125">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="dnsmasq"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1126">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="rtkit"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1127">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="speech-dispatcher"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="!" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1128">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="whoopsie"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1129">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="kernoops"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1130">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="saned"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1131">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="pulse"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1132">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="avahi"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1133">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="colord"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1134">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="hplip"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1135">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="geoclue"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1136">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gnome-initial-setup"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1137">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gdm"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1138">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sanh"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="$6$Suu88l4t$zESmGFeyBWwqLWUkCTg0CQeZgNJ7AI1XvoikwpQWtYbi0v62y4itEjIt9IJEw0hGI4b/qKgyeoYbkoIl5L6p50"
                              dt="string"
                              ev="^[^!*]"
                              name="password"
                              op="pattern match"
                              result="true"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1139">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="cups-pk-helper"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev="^[^!*]" name="password" op="pattern match"
                              result="false"/>
          <cis:evidence_field cv="" dt="int" ev="7" name="exp_inact" op="less than" result="false"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/default/useradd exists and matches pattern ^\s*INACTIVE\s*=\s*(30|[1-2][0-9]|[1-9])\s*(\s+#.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:807007"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807007"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2827">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/default/useradd"/>
             <cis:evidence_item_pk_field name="path" value="/etc/default"/>
             <cis:evidence_item_pk_field name="filename" value="useradd"/>
             <cis:evidence_item_pk_field name="pattern" value="^\s*INACTIVE\s*=\s*(30|[1-2][0-9]|[1-9])\s*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807007"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807013"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.4.1.5 Ensure all users last password change date is in the past

Description:

All users should have a password change date in the past.

If a users recorded password change date is in the future then they could bypass any set password expiration.

Investigate any users with a password change date in the future and correct them. Locking the account, expiring the password, or resetting the password manually may be appropriate.

Linux Custom Object "Ensure all users with a Password have password change date in the past" -- More
CIS-CAT Expected... CIS-CAT Collected...
the variable's value to be greater than or equal to 0 65022
the variable's value to be greater than or equal to 0 116618622

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.4.1.5_Ensure_all_users_last_password_change_date_is_in_the_past"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:42.983+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:42.983+07:00"
         start-time="2022-01-05T01:03:42.835+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Linux Custom Object &#34;Ensure all users with a Password have password change date in the past&#34;"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:8070193"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:807019"
                    type="variable_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:807019">
       <cis:evidence_item itemref="2831">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="var_ref"
                                         value="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:807019"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="65022" dt="int" ev="0" name="value" op="greater than or equal"
                              result="true"/>
          <cis:evidence_field cv="116618622" dt="int" ev="0" name="value" op="greater than or equal"
                              result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:807019"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Unknown

5.4.2 Ensure system accounts are secured

Description:

There are a number of accounts provided with most distributions that are used to manage applications and are not intended to provide an interactive shell.

It is important to make sure that accounts that are not being used by regular users are prevented from being used to provide an interactive shell. By default, most distributions set the password field for these accounts to an invalid string, but it is also recommended that the shell field in the password file be set to the nologin shell. This prevents the account from potentially being used to run any commands.

Run the commands appropriate for your distribution:

Set the shell for any accounts returned by the audit to nologin:

# usermod -s $(which nologin) <user>

Lock any non root accounts returned by the audit:

# usermod -L <user>

The following command will set all system accounts to a non login shell:

awk -F: '($1!="root" && $1!="sync" && $1!="shutdown" && $1!="halt" && $1!~/^\+/ && $3<'"$(awk '/^\s*UID_MIN/{print $2}' /etc/login.defs)"' && $7!="'"$(which nologin)"'" && $7!="/bin/false") {print $1}' /etc/passwd | while read -r user; do usermod -s "$(which nologin)" "$user"; done

The following command will automatically lock not root system accounts:

awk -F: '($1!="root" && $1!~/^\+/ && $3<'"$(awk '/^\s*UID_MIN/{print $2}' /etc/login.defs)"') {print $1}' /etc/passwd | xargs -I '{}' passwd -S '{}' | awk '($2!="L" && $2!="LK") {print $1}' | while read -r user; do usermod -L "$user"; done

All of the following tests or sub-groups must pass:
Ensure system accounts are secured -- More
Script: sce/account_disabled.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced
Linux Custom Object "System Accounts Locked" -- More
Check: All Must Pass
No testable evidence items were collected. Any number of items (including none) are expected for this test. In this case, when no evidence items are collected, the test Passes.

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.4.2_Ensure_system_accounts_are_secured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:43.166+07:00"
  version="1"
  weight="1.0">
<result>unknown</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:43.166+07:00"
         start-time="2022-01-05T01:03:43.105+07:00">
<cis:and>
 <cis:evidence_test comment="Ensure system accounts are secured" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/account_disabled.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Linux Custom Object &#34;System Accounts Locked&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806822"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806822"
                    type="shadow_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806822"/>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-content-ref href="sce/account_disabled.sh"/>
</check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806822"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

5.4.3 Ensure default group for the root account is GID 0

Description:

The usermod command can be used to specify which group the root user belongs to. This affects permissions of files that are created by the root user.

Using GID 0 for the root account helps prevent root -owned files from accidentally becoming accessible to non-privileged users.

Run the following command to set the root user default group to GID 0 :

# usermod -g 0 root

Linux Custom Object "Default Group Set For root User" -- More
Check: All Must Pass
User: root
CIS-CAT Expected... CIS-CAT Collected...
the Group ID to be set to 0 0

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.4.3_Ensure_default_group_for_the_root_account_is_GID_0"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:43.224+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:43.224+07:00"
         start-time="2022-01-05T01:03:43.197+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Linux Custom Object &#34;Default Group Set For root User&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806829"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806829"
                    type="password_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806829">
       <cis:evidence_item itemref="2835">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="root"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806829"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.4.4 Ensure default user umask is 027 or more restrictive

Description:

The default umask determines the permissions of files created by users. The user creating the file has the discretion of making their files and directories readable by others via the chmod command. Users who wish to allow their files and directories to be readable by others by default may choose a different default umask by inserting the umask command into the standard shell configuration files ( .profile , .bashrc , etc.) in their home directories.

Setting a very secure default value for umask ensures that users make a conscious choice about their file permissions. A default umask setting of 077 causes files and directories created by users to not be readable by any other user on the system. A umask of 027 would make files and directories readable by users in the same Unix group, while a umask of 022 would make files readable by every user on the system.

Edit the /etc/bash.bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any umask parameters as follows:

umask 027

All of the following tests or sub-groups must pass:
Ensure at least one file(s) named ^.+\.sh$ in /etc/profile.d/ exists and matches pattern ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/profile.d/xdg_dirs_desktop_session.sh does not exist
Pattern: ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/01-locale-fix.sh does not exist
Pattern: ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/bash_completion.sh does not exist
Pattern: ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/vte-2.91.sh does not exist
Pattern: ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/apps-bin-path.sh does not exist
Pattern: ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/cedilla-portuguese.sh does not exist
Pattern: ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/input-method-config.sh does not exist
Pattern: ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensure at least one file named /etc/profile exists and matches pattern ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/profile does not exist
Pattern: ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensure no file named /etc/bash.bashrc exists and matches pattern ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$ -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/bash.bashrc does not exist
Pattern: ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$
Match Text: No match found
Ensure at least one file named /etc/bash.bashrc exists and matches pattern ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/bash.bashrc does not exist
Pattern: ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$
Match Text: No match found
Any of the following tests or sub-groups may pass:
Ensure no file named /etc/profile exists and matches pattern ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$ -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/profile does not exist
Pattern: ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$
Match Text: No match found
Ensurefile(s) named ^.+\.sh$ in /etc/profile.d/ exists and matches pattern ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$ -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/profile.d/xdg_dirs_desktop_session.sh does not exist
Pattern: ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/01-locale-fix.sh does not exist
Pattern: ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/bash_completion.sh does not exist
Pattern: ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/vte-2.91.sh does not exist
Pattern: ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/apps-bin-path.sh does not exist
Pattern: ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/cedilla-portuguese.sh does not exist
Pattern: ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/input-method-config.sh does not exist
Pattern: ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.4.4_Ensure_default_user_umask_is_027_or_more_restrictive"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:43.315+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:43.315+07:00"
         start-time="2022-01-05T01:03:43.291+07:00">
<cis:and>
 <cis:and>
    <cis:and>
       <cis:and>
          <cis:evidence_test check="all" check_existence="none_exist"
                             comment="Ensure no file named /etc/bash.bashrc exists and matches pattern ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806836"
                             result="true"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806836"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2836">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/bash.bashrc"/>
                      <cis:evidence_item_pk_field name="path" value="/etc"/>
                      <cis:evidence_item_pk_field name="filename" value="bash.bashrc"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure at least one file named /etc/bash.bashrc exists and matches pattern ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806832"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806832"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2837">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/bash.bashrc"/>
                      <cis:evidence_item_pk_field name="path" value="/etc"/>
                      <cis:evidence_item_pk_field name="filename" value="bash.bashrc"/>
                      <cis:evidence_item_pk_field name="pattern" value="^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
       </cis:and>
       <cis:or>
          <cis:evidence_test check="all" check_existence="none_exist"
                             comment="Ensure no file named /etc/profile exists and matches pattern ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806847"
                             result="true"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806847"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2838">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/profile"/>
                      <cis:evidence_item_pk_field name="path" value="/etc"/>
                      <cis:evidence_item_pk_field name="filename" value="profile"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
          <cis:evidence_test check="all" check_existence="none_exist"
                             comment="Ensurefile(s) named ^.+\.sh$ in /etc/profile.d/ exists and matches pattern ^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806858"
                             result="true"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806858"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2846">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/xdg_dirs_desktop_session.sh"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                      <cis:evidence_item_pk_field name="filename" value="xdg_dirs_desktop_session.sh"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2847">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/01-locale-fix.sh"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                      <cis:evidence_item_pk_field name="filename" value="01-locale-fix.sh"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2848">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/bash_completion.sh"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                      <cis:evidence_item_pk_field name="filename" value="bash_completion.sh"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2849">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/vte-2.91.sh"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                      <cis:evidence_item_pk_field name="filename" value="vte-2.91.sh"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2850">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/apps-bin-path.sh"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                      <cis:evidence_item_pk_field name="filename" value="apps-bin-path.sh"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2851">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/cedilla-portuguese.sh"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                      <cis:evidence_item_pk_field name="filename" value="cedilla-portuguese.sh"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
                <cis:evidence_item itemref="2852">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/input-method-config.sh"/>
                      <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                      <cis:evidence_item_pk_field name="filename" value="input-method-config.sh"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*umask\s+[01234567](0[7654321]|[7654321][654321])\s*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
       </cis:or>
       <cis:evidence_test check="all" check_existence="at_least_one_exists"
                          comment="Ensure at least one file named /etc/profile exists and matches pattern ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806841"
                          result="false"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806841"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2853">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/profile"/>
                   <cis:evidence_item_pk_field name="path" value="/etc"/>
                   <cis:evidence_item_pk_field name="filename" value="profile"/>
                   <cis:evidence_item_pk_field name="pattern" value="^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:and>
    <cis:evidence_test check="at least one" check_existence="at_least_one_exists"
                       comment="Ensure at least one file(s) named ^.+\.sh$ in /etc/profile.d/ exists and matches pattern ^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806853"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806853"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2861">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/xdg_dirs_desktop_session.sh"/>
                <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                <cis:evidence_item_pk_field name="filename" value="xdg_dirs_desktop_session.sh"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2862">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/01-locale-fix.sh"/>
                <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                <cis:evidence_item_pk_field name="filename" value="01-locale-fix.sh"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2863">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/bash_completion.sh"/>
                <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                <cis:evidence_item_pk_field name="filename" value="bash_completion.sh"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2864">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/vte-2.91.sh"/>
                <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                <cis:evidence_item_pk_field name="filename" value="vte-2.91.sh"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2865">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/apps-bin-path.sh"/>
                <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                <cis:evidence_item_pk_field name="filename" value="apps-bin-path.sh"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2866">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/cedilla-portuguese.sh"/>
                <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                <cis:evidence_item_pk_field name="filename" value="cedilla-portuguese.sh"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
          <cis:evidence_item itemref="2867">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/input-method-config.sh"/>
                <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
                <cis:evidence_item_pk_field name="filename" value="input-method-config.sh"/>
                <cis:evidence_item_pk_field name="pattern" value="^\s*umask\s+[01234567][2367]7\s*(\s+#.*)?$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:and>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<xccdf:complex-check operator="AND">
<xccdf:complex-check operator="AND">
 <xccdf:complex-check operator="AND">
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806832"/>
    </check>
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806836"/>
    </check>
 </xccdf:complex-check>
 <xccdf:complex-check operator="OR">
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806847"/>
    </check>
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806858"/>
    </check>
 </xccdf:complex-check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806841"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806853"/>
</check>
</xccdf:complex-check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.4.5 Ensure default user shell timeout is 900 seconds or less

Description:

The default TMOUT determines the shell timeout for users. The TMOUT value is measured in seconds.

Having no timeout value associated with a shell could allow an unauthorized user access to another user's shell session (e.g. user walks away from their computer and doesn't lock the screen). Setting a timeout value at least reduces the risk of this happening.

Edit the /etc/bashrc , /etc/profile and /etc/profile.d/*.sh files (and the appropriate files for any other shell supported on your system) and add or edit any TMOUT parameters in accordance with site policy:

readonly TMOUT=900 ; export TMOUT

Note: setting the value to readonly prevents unwanted modification during runtime.

All of the following tests or sub-groups must pass:
Ensurefile(s) named ^.+\.sh$ in /etc/profile.d/ exists and matches pattern ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$ -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/profile.d/xdg_dirs_desktop_session.sh does not exist
Pattern: ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/01-locale-fix.sh does not exist
Pattern: ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/bash_completion.sh does not exist
Pattern: ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/vte-2.91.sh does not exist
Pattern: ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/apps-bin-path.sh does not exist
Pattern: ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/cedilla-portuguese.sh does not exist
Pattern: ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found
File: /etc/profile.d/input-method-config.sh does not exist
Pattern: ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensure at least one file named /etc/profile exists and matches pattern ^\s*(\S+\s+)*TMOUT=(900|[1-8][0-9][0-9]|[1-9][0-9]|[1-9])\b\s*(\S+\s*)*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/profile does not exist
Pattern: ^\s*(\S+\s+)*TMOUT=(900|[1-8][0-9][0-9]|[1-9][0-9]|[1-9])\b\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensure no file named /etc/profile exists and matches pattern ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$ -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/profile does not exist
Pattern: ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found
All of the following tests or sub-groups must pass:
Ensure no file named /etc/bash.bashrc exists and matches pattern ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$ -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/bash.bashrc does not exist
Pattern: ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found
Ensure at least one file named /etc/bash.bashrc exists and matches pattern ^\s*(\S+\s+)*TMOUT=(900|[1-8][0-9][0-9]|[1-9][0-9]|[1-9])\b\s*(\S+\s*)*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/bash.bashrc does not exist
Pattern: ^\s*(\S+\s+)*TMOUT=(900|[1-8][0-9][0-9]|[1-9][0-9]|[1-9])\b\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.4.5_Ensure_default_user_shell_timeout_is_900_seconds_or_less"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:43.466+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/11"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:43.467+07:00"
         start-time="2022-01-05T01:03:43.382+07:00">
<cis:and>
 <cis:and>
    <cis:and>
       <cis:and>
          <cis:evidence_test check="all" check_existence="none_exist"
                             comment="Ensure no file named /etc/bash.bashrc exists and matches pattern ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806869"
                             result="true"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806869"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2868">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/bash.bashrc"/>
                      <cis:evidence_item_pk_field name="path" value="/etc"/>
                      <cis:evidence_item_pk_field name="filename" value="bash.bashrc"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
          <cis:evidence_test check="all" check_existence="at_least_one_exists"
                             comment="Ensure at least one file named /etc/bash.bashrc exists and matches pattern ^\s*(\S+\s+)*TMOUT=(900|[1-8][0-9][0-9]|[1-9][0-9]|[1-9])\b\s*(\S+\s*)*(\s+#.*)?$"
                             negated="false"
                             ns="independent"
                             objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806865"
                             result="false"
                             testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806865"
                             type="textfilecontent54_test">
             <cis:evidence_object>
                <cis:evidence_item itemref="2869">
                   <cis:evidence_item_pk status="does not exist">
                      <cis:evidence_item_pk_field name="filepath" value="/etc/bash.bashrc"/>
                      <cis:evidence_item_pk_field name="path" value="/etc"/>
                      <cis:evidence_item_pk_field name="filename" value="bash.bashrc"/>
                      <cis:evidence_item_pk_field name="pattern"
                                                  value="^\s*(\S+\s+)*TMOUT=(900|[1-8][0-9][0-9]|[1-9][0-9]|[1-9])\b\s*(\S+\s*)*(\s+#.*)?$"/>
                   </cis:evidence_item_pk>
                </cis:evidence_item>
             </cis:evidence_object>
          </cis:evidence_test>
       </cis:and>
       <cis:evidence_test check="all" check_existence="none_exist"
                          comment="Ensure no file named /etc/profile exists and matches pattern ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"
                          negated="false"
                          ns="independent"
                          objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806873"
                          result="true"
                          testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806873"
                          type="textfilecontent54_test">
          <cis:evidence_object>
             <cis:evidence_item itemref="2870">
                <cis:evidence_item_pk status="does not exist">
                   <cis:evidence_item_pk_field name="filepath" value="/etc/profile"/>
                   <cis:evidence_item_pk_field name="path" value="/etc"/>
                   <cis:evidence_item_pk_field name="filename" value="profile"/>
                   <cis:evidence_item_pk_field name="pattern"
                                               value="^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"/>
                </cis:evidence_item_pk>
             </cis:evidence_item>
          </cis:evidence_object>
       </cis:evidence_test>
    </cis:and>
    <cis:evidence_test check="all" check_existence="at_least_one_exists"
                       comment="Ensure at least one file named /etc/profile exists and matches pattern ^\s*(\S+\s+)*TMOUT=(900|[1-8][0-9][0-9]|[1-9][0-9]|[1-9])\b\s*(\S+\s*)*(\s+#.*)?$"
                       negated="false"
                       ns="independent"
                       objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806877"
                       result="false"
                       testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806877"
                       type="textfilecontent54_test">
       <cis:evidence_object>
          <cis:evidence_item itemref="2871">
             <cis:evidence_item_pk status="does not exist">
                <cis:evidence_item_pk_field name="filepath" value="/etc/profile"/>
                <cis:evidence_item_pk_field name="path" value="/etc"/>
                <cis:evidence_item_pk_field name="filename" value="profile"/>
                <cis:evidence_item_pk_field name="pattern"
                                            value="^\s*(\S+\s+)*TMOUT=(900|[1-8][0-9][0-9]|[1-9][0-9]|[1-9])\b\s*(\S+\s*)*(\s+#.*)?$"/>
             </cis:evidence_item_pk>
          </cis:evidence_item>
       </cis:evidence_object>
    </cis:evidence_test>
 </cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Ensurefile(s) named ^.+\.sh$ in /etc/profile.d/ exists and matches pattern ^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806881"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806881"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2879">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/xdg_dirs_desktop_session.sh"/>
             <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
             <cis:evidence_item_pk_field name="filename" value="xdg_dirs_desktop_session.sh"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2880">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/01-locale-fix.sh"/>
             <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
             <cis:evidence_item_pk_field name="filename" value="01-locale-fix.sh"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2881">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/bash_completion.sh"/>
             <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
             <cis:evidence_item_pk_field name="filename" value="bash_completion.sh"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2882">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/vte-2.91.sh"/>
             <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
             <cis:evidence_item_pk_field name="filename" value="vte-2.91.sh"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2883">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/apps-bin-path.sh"/>
             <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
             <cis:evidence_item_pk_field name="filename" value="apps-bin-path.sh"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2884">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/cedilla-portuguese.sh"/>
             <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
             <cis:evidence_item_pk_field name="filename" value="cedilla-portuguese.sh"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="2885">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/profile.d/input-method-config.sh"/>
             <cis:evidence_item_pk_field name="path" value="/etc/profile.d"/>
             <cis:evidence_item_pk_field name="filename" value="input-method-config.sh"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*(\S+\s+)*TMOUT=(90[1-9]|9[1-9][0-9]|[1-9][0-9]{3,})\b\s*(\S+\s*)*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<xccdf:complex-check operator="AND">
<xccdf:complex-check operator="AND">
 <xccdf:complex-check operator="AND">
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806865"/>
    </check>
    <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
       <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                          name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806869"/>
    </check>
 </xccdf:complex-check>
 <check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
    <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                       name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806873"/>
 </check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
 <check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                    name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806877"/>
</check>
</xccdf:complex-check>
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806881"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

5.6 Ensure access to the su command is restricted

Description:

The su command allows a user to run a command or shell as another user. The program has been superseded by sudo , which allows for more granular control over privileged access. Normally, the su command can be executed by any user. By uncommenting the pam_wheel.so statement in /etc/pam.d/su , the su command will only allow users in a specific groups to execute su . This group should be empty to reinforce the use of sudo for privileged access.

Restricting the use of su , and using sudo in its place, provides system administrators better control of the escalation of user privileges to execute privileged commands. The sudo utility also provides a better logging and audit mechanism, as it can log each command executed via sudo , whereas su can only record that a user executed the su program.

Create an empty group that will be specified for use of the su command. The group should be named according to site policy.

groupadd sugroup

Add the following line to the /etc/pam.d/su file, specifying the empty group:

auth required pam_wheel.so use_uid group=sugroup

Ensure at least one file named /etc/pam.d/su exists and matches pattern ^\s*auth\s+required\s+pam_wheel\.so\s+(\S+\s+)*use_uid\s+(\S+\s+)*group=\S+\s*(\S+\s*)*(\s+#.*)?$ -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/pam.d/su does not exist
Pattern: ^\s*auth\s+required\s+pam_wheel\.so\s+(\S+\s+)*use_uid\s+(\S+\s+)*group=\S+\s*(\S+\s*)*(\s+#.*)?$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_5.6_Ensure_access_to_the_su_command_is_restricted"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:43.524+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:43.524+07:00"
         start-time="2022-01-05T01:03:43.519+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/pam.d/su exists and matches pattern ^\s*auth\s+required\s+pam_wheel\.so\s+(\S+\s+)*use_uid\s+(\S+\s+)*group=\S+\s*(\S+\s*)*(\s+#.*)?$"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806662"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806662"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2886">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/pam.d/su"/>
             <cis:evidence_item_pk_field name="path" value="/etc/pam.d"/>
             <cis:evidence_item_pk_field name="filename" value="su"/>
             <cis:evidence_item_pk_field name="pattern"
                                         value="^\s*auth\s+required\s+pam_wheel\.so\s+(\S+\s+)*use_uid\s+(\S+\s+)*group=\S+\s*(\S+\s*)*(\s+#.*)?$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806662"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

6 System Maintenance

Recommendations in this section are intended as maintenance and are intended to be checked on a frequent basis to ensure system stability. Many recommendations do not have quick remediations and require investigation into the cause and best fix available and may indicate an attempted breach of system security.

6.1 System File Permissions

This section provides guidance on securing aspects of system files and directories.

Pass

6.1.2 Ensure permissions on /etc/passwd are configured

Description:

The /etc/passwd file contains user account information that is used by many system utilities and therefore must be readable for these utilities to operate.

It is critical to ensure that the /etc/passwd file is protected from unauthorized write access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions.

Run the following command to set permissions on /etc/passwd :

# chown root:root /etc/passwd # chmod u-x,go-wx /etc/passwd

Ensure at least one file named /etc/passwd exists and is owned by 0:0 and does not have permissions --x-wx-wx -- More
File: /etc/passwd
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Owner Execute to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.1.2_Ensure_permissions_on_etcpasswd_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:49.133+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:49.133+07:00"
         start-time="2022-01-05T01:03:49.105+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/passwd exists and is owned by 0:0 and does not have permissions --x-wx-wx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806725"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806725"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806725">
       <cis:evidence_item itemref="2887">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/passwd"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="passwd"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="uexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806725"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.1.3 Ensure permissions on /etc/gshadow- are configured

Description:

The /etc/gshadow- file is used to store backup information about groups that is critical to the security of those accounts, such as the hashed password and other security information.

It is critical to ensure that the /etc/gshadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions.

Run the one of the following chown commands as appropriate and the chmod to set permissions on /etc/gshadow- :

# chown root:root /etc/gshadow-

OR

# chown root:shadow /etc/gshadow- # chmod g-wx,o-rwx /etc/gshadow-

Ensure at least one file named /etc/gshadow- exists and is owned by user 0 and does not have permissions --x-wxrwx SUID -- More
File: /etc/gshadow-
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's User ID to be set to 0 0
the file's Owner Execute to be set to false false
the file's SUID to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.1.3_Ensure_permissions_on_etcgshadow-_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:49.247+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:49.248+07:00"
         start-time="2022-01-05T01:03:49.218+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/gshadow- exists and is owned by user 0 and does not have permissions --x-wxrwx SUID"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806784"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806784"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806784">
       <cis:evidence_item itemref="2888">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/gshadow-"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="gshadow-"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="uexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="suid" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806784"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.1.4 Ensure permissions on /etc/shadow are configured

Description:

The /etc/shadow file is used to store the information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information.

If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert the user accounts.

Run the one following commands to set permissions on /etc/shadow :

# chmod o-rwx,g-wx /etc/shadow # chown root:shadow /etc/shadow

Ensure at least one file named /etc/shadow exists and is owned by user 0 and does not have permissions --x-wxrwx SUID SGID sticky -- More
File: /etc/shadow
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's User ID to be set to 0 0
the file's Owner Execute to be set to false false
the file's Sticky Bit to be set to false false
the file's SGID to be set to false false
the file's SUID to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.1.4_Ensure_permissions_on_etcshadow_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:49.356+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:49.356+07:00"
         start-time="2022-01-05T01:03:49.331+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/shadow exists and is owned by user 0 and does not have permissions --x-wxrwx SUID SGID sticky"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806732"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806732"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806732">
       <cis:evidence_item itemref="2889">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/shadow"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="shadow"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="uexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="sticky" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="sgid" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="suid" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806732"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.1.5 Ensure permissions on /etc/group are configured

Description:

The /etc/group file contains a list of all the valid groups defined in the system. The command below allows read/write access for root and read access for everyone else.

The /etc/group file needs to be protected from unauthorized changes by non-privileged users, but needs to be readable as this information is used with many non-privileged programs.

Run the following command to set permissions on /etc/group :

# chown root:root /etc/group

# chmod 644 /etc/group

Ensure at least one file named /etc/group exists and is owned by 0:0 and does not have permissions --x-wx-wx -- More
File: /etc/group
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Owner Execute to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.1.5_Ensure_permissions_on_etcgroup_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:49.446+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:49.446+07:00"
         start-time="2022-01-05T01:03:49.432+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/group exists and is owned by 0:0 and does not have permissions --x-wx-wx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806740"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806740"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806740">
       <cis:evidence_item itemref="2890">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/group"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="group"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="uexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806740"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

6.1.6 Ensure permissions on /etc/passwd- are configured

Description:

The /etc/passwd- file contains backup user account information.

It is critical to ensure that the /etc/passwd- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions.

Run the following command to set permissions on /etc/passwd- :

# chown root:root /etc/passwd-

# chmod u-x,go-rwx /etc/passwd-

Ensure at least one file named /etc/passwd- exists and is owned by 0:0 and does not have permissions --xrwxrwx -- Less
File: /etc/passwd-
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false true
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Owner Execute to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Read to be set to false true
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.1.6_Ensure_permissions_on_etcpasswd-_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:49.559+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:49.559+07:00"
         start-time="2022-01-05T01:03:49.509+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/passwd- exists and is owned by 0:0 and does not have permissions --xrwxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806758"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806758"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806758">
       <cis:evidence_item itemref="2891">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/passwd-"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="passwd-"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="uexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806758"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

6.1.7 Ensure permissions on /etc/shadow- are configured

Description:

The /etc/shadow- file is used to store backup information about user accounts that is critical to the security of those accounts, such as the hashed password and other security information.

It is critical to ensure that the /etc/shadow- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions.

Run the following commands to set permissions on /etc/shadow- :

# chown root:shadow /etc/shadow- # chmod u-x,go-rwx /etc/shadow-

Ensure at least one file named /etc/shadow- exists and is owned by user 0 and does not have permissions --xrwxrwx -- Less
File: /etc/shadow-
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's User ID to be set to 0 0
the file's Owner Execute to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Read to be set to false true
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.1.7_Ensure_permissions_on_etcshadow-_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:49.656+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:49.656+07:00"
         start-time="2022-01-05T01:03:49.620+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/shadow- exists and is owned by user 0 and does not have permissions --xrwxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806767"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806767"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806767">
       <cis:evidence_item itemref="2892">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/shadow-"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="shadow-"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="uexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="gread" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806767"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.1.8 Ensure permissions on /etc/group- are configured

Description:

The /etc/group- file contains a backup list of all the valid groups defined in the system.

It is critical to ensure that the /etc/group- file is protected from unauthorized access. Although it is protected by default, the file permissions could be changed either inadvertently or through malicious actions.

Run the following command to set permissions on /etc/group- :

# chown root:root /etc/group-

# chmod u-x,go-wx /etc/group-

Ensure at least one file named /etc/group- exists and is owned by 0:0 and does not have permissions --x-wx-wx -- More
File: /etc/group-
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Group ID to be set to 0 0
the file's User ID to be set to 0 0
the file's Owner Execute to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.1.8_Ensure_permissions_on_etcgroup-_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:49.753+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:49.753+07:00"
         start-time="2022-01-05T01:03:49.739+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/group- exists and is owned by 0:0 and does not have permissions --x-wx-wx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806775"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806775"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806775">
       <cis:evidence_item itemref="2893">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/group-"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="group-"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="group_id" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="uexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806775"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.1.9 Ensure permissions on /etc/gshadow are configured

Description:

The /etc/gshadow file is used to store the information about groups that is critical to the security of those accounts, such as the hashed password and other security information.

If attackers can gain read access to the /etc/gshadow file, they can easily run a password cracking program against the hashed password to break it. Other security information that is stored in the /etc/gshadow file (such as group administrators) could also be useful to subvert the group.

Run the following commands to set permissions on /etc/gshadow :

# chown root:shadow /etc/gshadow

# chmod o-rwx,g-wx /etc/gshadow

Ensure at least one file named /etc/gshadow exists and is owned by user 0 and does not have permissions --x-wxrwx -- More
File: /etc/gshadow
CIS-CAT Expected... CIS-CAT Collected...
the file's Group Execute to be set to false false
the file's Other Read to be set to false false
the file's User ID to be set to 0 0
the file's Owner Execute to be set to false false
the file's Other Execute to be set to false false
the file's Other Write to be set to false false
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.1.9_Ensure_permissions_on_etcgshadow_are_configured"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:49.786+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:49.786+07:00"
         start-time="2022-01-05T01:03:49.755+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/gshadow exists and is owned by user 0 and does not have permissions --x-wxrwx"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806749"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806749"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806749">
       <cis:evidence_item itemref="2894">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/etc/gshadow"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="gshadow"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oread" op="equals" result="true"/>
          <cis:evidence_field cv="0" dt="int" ev="0" name="user_id" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="uexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="oexec" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806749"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.1.10 Ensure no world writable files exist

Description:

Unix-based systems support variable settings to control access to files. World writable files are the least secure. See the chmod(2) man page for more information.

Data in world-writable files can be modified and compromised by any user on the system. World writable files may also indicate an incorrectly written script or program that could potentially be the cause of a larger compromise to the system's integrity.

Removing write access for the "other" category ( chmod o-w <filename> ) is advisable, but always consult relevant vendor documentation to avoid breaking any application dependencies on a given file.

Ensure no world writable files exist -- More
Script: sce/world_writable_files.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.1.10_Ensure_no_world_writable_files_exist"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:44.696+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:44.697+07:00"
         start-time="2022-01-05T01:03:43.608+07:00">
<cis:and>
 <cis:evidence_test comment="Ensure no world writable files exist" result="pass">
    <cis:evidence_sce exit-code="101"
                      full-path="/home/sanh/Downloads/ciscat_linux/sce/world_writable_files.sh"
                      href="sce/world_writable_files.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-content-ref href="sce/world_writable_files.sh"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.1.11 Ensure no unowned files or directories exist

Description:

Sometimes when administrators delete users from the password file they neglect to remove all files owned by those users from the system.

A new user who is assigned the deleted user's user ID or group ID may then end up "owning" these files, and thus have more access on the system than was intended.

Locate files that are owned by users or groups not listed in the system configuration files, and reset the ownership of these files to some active user on the system as appropriate.

Ensure no unowned files or directories exist -- More
Script: sce/no_unowned_files_and_directories.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.1.11_Ensure_no_unowned_files_or_directories_exist"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:47.009+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/13/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:47.009+07:00"
         start-time="2022-01-05T01:03:44.750+07:00">
<cis:and>
 <cis:evidence_test comment="Ensure no unowned files or directories exist" result="pass">
    <cis:evidence_sce exit-code="101"
                      full-path="/home/sanh/Downloads/ciscat_linux/sce/no_unowned_files_and_directories.sh"
                      href="sce/no_unowned_files_and_directories.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-content-ref href="sce/no_unowned_files_and_directories.sh"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.1.12 Ensure no ungrouped files or directories exist

Description:

Sometimes when administrators delete users or groups from the system they neglect to remove all files owned by those users or groups.

A new user who is assigned the deleted user's user ID or group ID may then end up "owning" these files, and thus have more access on the system than was intended.

Locate files that are owned by users or groups not listed in the system configuration files, and reset the ownership of these files to some active user on the system as appropriate.

Ensure no ungrouped files or directories exist -- More
Script: sce/no_ungrouped_files_and_directories.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.1.12_Ensure_no_ungrouped_files_or_directories_exist"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:49.037+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/13/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:49.037+07:00"
         start-time="2022-01-05T01:03:47.080+07:00">
<cis:and>
 <cis:evidence_test comment="Ensure no ungrouped files or directories exist" result="pass">
    <cis:evidence_sce exit-code="101"
                      full-path="/home/sanh/Downloads/ciscat_linux/sce/no_ungrouped_files_and_directories.sh"
                      href="sce/no_ungrouped_files_and_directories.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-content-ref href="sce/no_ungrouped_files_and_directories.sh"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

6.2 User and Group Settings

This section provides guidance on securing aspects of the users and groups.

Note: The recommendations in this section check local users and groups. Any users or groups from other sources such as LDAP will not be audited. In a domain environment similar checks should be performed against domain users and groups.

Pass

6.2.1 Ensure password fields are not empty

Description:

An account with an empty password field means that anybody may log in as that user without providing a password.

All accounts must have passwords or be locked to prevent the account from being used by an unauthorized user.

If any accounts in the /etc/shadow file do not have a password, run the following command to lock the account until it can be determined why it does not have a password:

# passwd -l <username>

Also, check to see if the account is logged in and investigate what it is being used for to determine if it needs to be forced off.

Ensure usernames pattern match .+ have shadow parameter password Pattern Match .+ (string) -- More
Check: All Must Pass
User: root
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ !
User: daemon
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: bin
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: sys
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: sync
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: games
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: man
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: lp
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: mail
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: news
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: uucp
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: proxy
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: www-data
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: backup
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: list
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: irc
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: gnats
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: nobody
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: systemd-network
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: systemd-resolve
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: syslog
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: messagebus
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: _apt
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: uuidd
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: avahi-autoipd
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: usbmux
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: dnsmasq
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: rtkit
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: speech-dispatcher
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ !
User: whoopsie
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: kernoops
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: saned
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: pulse
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: avahi
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: colord
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: hplip
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: geoclue
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: gnome-initial-setup
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: gdm
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *
User: sanh
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ $6$Suu88l4t$zESmGFeyBWwqLWUkCTg0CQeZgNJ7AI1XvoikwpQWtYbi0v62y4itEjIt9IJEw0hGI4b/qKgyeoYbkoIl5L6p50
User: cups-pk-helper
CIS-CAT Expected... CIS-CAT Collected...
the Encrypted Password matches the regular expression .+ *

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.1_Ensure_password_fields_are_not_empty"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:53.044+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:53.044+07:00"
         start-time="2022-01-05T01:03:53.039+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure usernames pattern match .+ have shadow parameter password Pattern Match .+ (string)"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806727"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806727"
                    type="shadow_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806727">
       <cis:evidence_item itemref="1099">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="root"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="!" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1100">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="daemon"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1101">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="bin"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1102">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sys"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1103">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sync"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1104">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="games"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1105">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="man"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1106">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="lp"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1107">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="mail"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1108">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="news"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1109">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="uucp"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1110">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="proxy"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1111">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="www-data"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1112">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="backup"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1113">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="list"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1114">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="irc"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1115">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gnats"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1116">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="nobody"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1117">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="systemd-network"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1118">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="systemd-resolve"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1119">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="syslog"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1120">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="messagebus"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1121">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="_apt"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1122">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="uuidd"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1123">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="avahi-autoipd"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1124">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="usbmux"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1125">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="dnsmasq"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1126">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="rtkit"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1127">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="speech-dispatcher"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="!" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1128">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="whoopsie"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1129">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="kernoops"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1130">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="saned"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1131">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="pulse"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1132">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="avahi"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1133">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="colord"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1134">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="hplip"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1135">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="geoclue"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1136">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gnome-initial-setup"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1137">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gdm"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1138">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sanh"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="$6$Suu88l4t$zESmGFeyBWwqLWUkCTg0CQeZgNJ7AI1XvoikwpQWtYbi0v62y4itEjIt9IJEw0hGI4b/qKgyeoYbkoIl5L6p50"
                              dt="string"
                              ev=".+"
                              name="password"
                              op="pattern match"
                              result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="1139">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="cups-pk-helper"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="*" dt="string" ev=".+" name="password" op="pattern match" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-export export-name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806727"
            value-id="xccdf_org.cisecurity.benchmarks_value_806727_var"/>
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806727"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.2 Ensure no legacy "+" entries exist in /etc/passwd

Description:

The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms.

These entries may provide an avenue for attackers to gain privileged access on the system.

Remove any legacy '+' entries from /etc/passwd if they exist.

Ensure at least one file named /etc/passwd exists and does not match pattern ^\+: -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/passwd does not exist
Pattern: ^\+:
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.2_Ensure_no_legacy__entries_exist_in_etcpasswd"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:53.096+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:53.096+07:00"
         start-time="2022-01-05T01:03:53.093+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/passwd exists and does not match pattern ^\+:"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806731"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806731"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="3377">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/passwd"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="passwd"/>
             <cis:evidence_item_pk_field name="pattern" value="^\+:"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806731"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.3 Ensure all users' home directories exist

Description:

Users can be defined in /etc/passwd without a home directory or with a home directory that does not actually exist.

If the user's home directory does not exist or is unassigned, the user will be placed in "/" and will not be able to write any files or have local environment variables set.

If any users' home directories do not exist, create them and make sure the respective user owns the directory. Users without an assigned home directory should be removed or assigned a home directory as appropriate.

Linux Custom Object "All User Home Directories Exist" -- More
CIS-CAT expected every collected file item to exist on the target system, and found 1 item.
File: /home/sanh exists

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.3_Ensure_all_users_home_directories_exist"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:53.475+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:53.475+07:00"
         start-time="2022-01-05T01:03:53.156+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="all_exist"
                    comment="Linux Custom Object &#34;All User Home Directories Exist&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806757"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806757"
                    type="file_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="3419">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="path" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="filename" value="NIL"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806757"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.4 Ensure no legacy "+" entries exist in /etc/shadow

Description:

The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms.

These entries may provide an avenue for attackers to gain privileged access on the system.

Remove any legacy '+' entries from /etc/shadow if they exist.

Ensure at least one file named /etc/shadow exists and does not match pattern ^\+: -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/shadow does not exist
Pattern: ^\+:
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.4_Ensure_no_legacy__entries_exist_in_etcshadow"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:53.523+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc6:controlURI="http://cisecurity.org/20-cc/v6.1/control/16/subcontrol/9"
system="http://cisecurity.org/20-cc/v6.1"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:53.523+07:00"
         start-time="2022-01-05T01:03:53.522+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/shadow exists and does not match pattern ^\+:"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806736"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806736"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="3420">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/shadow"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="shadow"/>
             <cis:evidence_item_pk_field name="pattern" value="^\+:"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806736"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Critical Controls:

  • Control 16: Account Monitoring and Control: -- More
    Critical Control Information
    Control: Actively manage the life cycle of system and application accounts – their creation, use, dormancy, deletion – in order to minimize opportunities for attackers to leverage them.
    Subcontrol: 16.9
    Label: Configure Account Access Centrally
    Description: Configure access for all accounts through a centralized point of authentication, for example Active Directory or LDAP. Configure network and security devices for centralized authentication as well.

Pass

6.2.5 Ensure no legacy "+" entries exist in /etc/group

Description:

The character + in various files used to be markers for systems to insert data from NIS maps at a certain point in a system configuration file. These entries are no longer required on most systems, but may exist in files that have been imported from other platforms.

These entries may provide an avenue for attackers to gain privileged access on the system.

Remove any legacy '+' entries from /etc/group if they exist.

Ensure at least one file named /etc/group exists and does not match pattern ^\+: -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/group does not exist
Pattern: ^\+:
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.5_Ensure_no_legacy__entries_exist_in_etcgroup"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:53.530+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/2"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:53.531+07:00"
         start-time="2022-01-05T01:03:53.525+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/group exists and does not match pattern ^\+:"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806741"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806741"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="3421">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/group"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="group"/>
             <cis:evidence_item_pk_field name="pattern" value="^\+:"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806741"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.6 Ensure root is the only UID 0 account

Description:

Any account with UID 0 has superuser privileges on the system.

This access must be limited to only the default root account and only from the system console. Administrative access must be through an unprivileged account using an approved mechanism as noted in Item 5.6 Ensure access to the su command is restricted.

Remove any users other than root with UID 0 or assign them a new UID if appropriate.

Ensure at least one file named /etc/passwd exists and does not match pattern ^(?!root:)[^:]*:[^:]*:0 -- Less
CIS-CAT expected at least 1 matching text file content item to be collected, and found 0 items.
File: /etc/passwd does not exist
Pattern: ^(?!root:)[^:]*:[^:]*:0
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.6_Ensure_root_is_the_only_UID_0_account"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:53.539+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/4/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:53.540+07:00"
         start-time="2022-01-05T01:03:53.532+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Ensure at least one file named /etc/passwd exists and does not match pattern ^(?!root:)[^:]*:[^:]*:0"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806747"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806747"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="3422">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/passwd"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="passwd"/>
             <cis:evidence_item_pk_field name="pattern" value="^(?!root:)[^:]*:[^:]*:0"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806747"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Unknown

6.2.7 Ensure root PATH Integrity

Description:

The root user can execute any command on the system and could be fooled into executing programs unintentionally if the PATH is not set correctly.

Including the current working directory (.) or other writable directory in root 's executable path makes it likely that an attacker can gain superuser access by forcing an administrator operating as root to execute a Trojan horse program.

Correct or justify any items discovered in the Audit step.

Ensure root PATH Integrity -- More
Script: sce/root_path.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.7_Ensure_root_PATH_Integrity"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:53.666+07:00"
  version="1"
  weight="1.0">
<result>unknown</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:53.666+07:00"
         start-time="2022-01-05T01:03:53.666+07:00">
<cis:and>
 <cis:evidence_test comment="Ensure root PATH Integrity" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/root_path.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-content-ref href="sce/root_path.sh"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Fail

6.2.8 Ensure users' home directories permissions are 750 or more restrictive

Description:

While the system administrator can establish secure permissions for users' home directories, the users can easily override these.

Group or world-writable user home directories may enable malicious users to steal or modify other users' data or to gain another user's system privileges.

Making global modifications to user home directories without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user file permissions and determine the action to be taken in accordance with site policy.

Linux Custom Object "No User Home Directories Have Permissions ----w-rwx" -- Less
File: /home/sanh
CIS-CAT Expected... CIS-CAT Collected...
the file's Other Read to be set to false true
the file's Other Execute to be set to false true
the file's Other Write to be set to false false
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.8_Ensure_users_home_directories_permissions_are_750_or_more_restrictive"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:53.902+07:00"
  version="1"
  weight="1.0">
<result>fail</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:53.902+07:00"
         start-time="2022-01-05T01:03:53.668+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Linux Custom Object &#34;No User Home Directories Have Permissions ----w-rwx&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806762"
                    result="false"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806762"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806762">
       <cis:evidence_item itemref="3464">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="path" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="filename" value="NIL"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oread" op="equals" result="false"/>
          <cis:evidence_field cv="true" dt="boolean" ev="false" name="oexec" op="equals" result="false"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806762"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Unknown

6.2.9 Ensure users own their home directories

Description:

The user home directory is space defined for the particular user to set local environment variables and to store personal files.

Since the user is accountable for files stored in the user home directory, the user must be the owner of the directory.

Change the ownership of any home directories that are not owned by the defined user to the correct user.

Ensure users own their home directories -- More
Script: sce/users_own_home_directory.sh
Standard Output:
No Standard Output was produced
Standard Error:
No Standard Error was produced

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.9_Ensure_users_own_their_home_directories"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:53.966+07:00"
  version="1"
  weight="1.0">
<result>unknown</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:53.967+07:00"
         start-time="2022-01-05T01:03:53.966+07:00">
<cis:and>
 <cis:evidence_test comment="Ensure users own their home directories" result="unknown">
    <cis:evidence_sce exit-code="-1" full-path="" href="sce/users_own_home_directory.sh">
       <cis:environment_variables>
          <cis:environment_variable var_name="XCCDF_RESULT_FIXED" var_value="109"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_APPLICABLE" var_value="105"/>
          <cis:environment_variable var_name="XCCDF_RESULT_INFORMATIONAL" var_value="108"/>
          <cis:environment_variable var_name="XCCDF_RESULT_UNKNOWN" var_value="104"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_SELECTED" var_value="107"/>
          <cis:environment_variable var_name="XCCDF_RESULT_PASS" var_value="101"/>
          <cis:environment_variable var_name="XCCDF_RESULT_ERROR" var_value="103"/>
          <cis:environment_variable var_name="XCCDF_RESULT_FAIL" var_value="102"/>
          <cis:environment_variable var_name="XCCDF_RESULT_NOT_CHECKED" var_value="106"/>
       </cis:environment_variables>
    </cis:evidence_sce>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://open-scap.org/page/SCE">
<check-import import-name="stdout"/>
<check-content-ref href="sce/users_own_home_directory.sh"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.10 Ensure users' dot files are not group or world writable

Description:

While the system administrator can establish secure permissions for users' "dot" files, the users can easily override these.

Group or world-writable user configuration files may enable malicious users to steal or modify other users' data or to gain another user's system privileges.

Making global modifications to users' files without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user dot file permissions and determine the action to be taken in accordance with site policy.

Linux Custom Object "No User Dot Files Have Permissions ----w--w-" -- More
File: /home/sanh/.bashrc
CIS-CAT Expected... CIS-CAT Collected...
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /home/sanh/.sudo_as_admin_successful
CIS-CAT Expected... CIS-CAT Collected...
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /home/sanh/.bash_history
CIS-CAT Expected... CIS-CAT Collected...
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /home/sanh/.profile
CIS-CAT Expected... CIS-CAT Collected...
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /home/sanh/.bash_logout
CIS-CAT Expected... CIS-CAT Collected...
the file's Other Write to be set to false false
the file's Group Write to be set to false false
File: /home/sanh/.ICEauthority
CIS-CAT Expected... CIS-CAT Collected...
the file's Other Write to be set to false false
the file's Group Write to be set to false false

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.10_Ensure_users_dot_files_are_not_group_or_world_writable"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:50.467+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:50.467+07:00"
         start-time="2022-01-05T01:03:49.857+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Linux Custom Object &#34;No User Dot Files Have Permissions ----w--w-&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806772"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806772"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806772">
       <cis:evidence_item itemref="2941">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/home/sanh/.bashrc"/>
             <cis:evidence_item_pk_field name="path" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="filename" value=".bashrc"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2942">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/home/sanh/.sudo_as_admin_successful"/>
             <cis:evidence_item_pk_field name="path" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="filename" value=".sudo_as_admin_successful"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2943">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/home/sanh/.bash_history"/>
             <cis:evidence_item_pk_field name="path" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="filename" value=".bash_history"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2944">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/home/sanh/.profile"/>
             <cis:evidence_item_pk_field name="path" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="filename" value=".profile"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2945">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/home/sanh/.bash_logout"/>
             <cis:evidence_item_pk_field name="path" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="filename" value=".bash_logout"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
       <cis:evidence_item itemref="2946">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="filepath" value="/home/sanh/.ICEauthority"/>
             <cis:evidence_item_pk_field name="path" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="filename" value=".ICEauthority"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="owrite" op="equals" result="true"/>
          <cis:evidence_field cv="false" dt="boolean" ev="false" name="gwrite" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806772"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.11 Ensure no users have .forward files

Description:

The .forward file specifies an email address to forward the user's mail to.

Use of the .forward file poses a security risk in that sensitive data may be inadvertently transferred outside the organization. The .forward file also poses a risk as it can be used to execute commands that may perform unintended actions.

Making global modifications to users' files without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user .forward files and determine the action to be taken in accordance with site policy.

Linux Custom Object "No User Home Directories Contain .forward Files" -- More
CIS-CAT did not expect to collect any file items, and found 0 items.
File: /home/sanh/.forward does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.11_Ensure_no_users_have_.forward_files"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:50.888+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/5/subcontrol/1"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:50.888+07:00"
         start-time="2022-01-05T01:03:50.610+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Linux Custom Object &#34;No User Home Directories Contain .forward Files&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806778"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806778"
                    type="file_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="2987">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="path" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="filename" value=".forward"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806778"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.12 Ensure no users have .netrc files

Description:

The .netrc file contains data for logging into a remote host for file transfers via FTP.

The .netrc file presents a significant security risk since it stores passwords in unencrypted form. Even if FTP is disabled, user accounts may have brought over .netrc files from other systems which could pose a risk to those systems.

Making global modifications to users' files without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user .netrc files and determine the action to be taken in accordance with site policy.

Linux Custom Object "No User Home Directories Contain .netrc Files" -- More
CIS-CAT did not expect to collect any file items, and found 0 items.
File: /home/sanh/.netrc does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.12_Ensure_no_users_have_.netrc_files"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:51.241+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:51.241+07:00"
         start-time="2022-01-05T01:03:50.952+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Linux Custom Object &#34;No User Home Directories Contain .netrc Files&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806781"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806781"
                    type="file_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="3028">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="path" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="filename" value=".netrc"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806781"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.13 Ensure users' .netrc Files are not group or world accessible

Description:

While the system administrator can establish secure permissions for users' .netrc files, the users can easily override these.

.netrc files may contain unencrypted passwords that may be used to attack other systems.

Making global modifications to users' files without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user .netrc file permissions and determine the action to be taken in accordance with site policy.

Linux Custom Object "No User .netrc Files Have Permissions ---rwxrwx" -- More
No testable evidence items were collected. Any number of items (including none) are expected for this test. In this case, when no evidence items are collected, the test Passes.

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.13_Ensure_users_.netrc_Files_are_not_group_or_world_accessible"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:51.626+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:51.626+07:00"
         start-time="2022-01-05T01:03:51.348+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="any_exist"
                    comment="Linux Custom Object &#34;No User .netrc Files Have Permissions ---rwxrwx&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806789"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806789"
                    type="file_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806789"/>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806789"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.14 Ensure no users have .rhosts files

Description:

While no .rhosts files are shipped by default, users can easily create them.

This action is only meaningful if .rhosts support is permitted in the file /etc/pam.conf . Even though the .rhosts files are ineffective if support is disabled in /etc/pam.conf , they may have been brought over from other systems and could contain information useful to an attacker for those other systems.

Making global modifications to users' files without alerting the user community can result in unexpected outages and unhappy users. Therefore, it is recommended that a monitoring policy be established to report user .rhosts files and determine the action to be taken in accordance with site policy.

Linux Custom Object "No User Home Directories Contain .rhost Files" -- More
CIS-CAT did not expect to collect any file items, and found 0 items.
File: /home/sanh/.rhost does not exist

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.14_Ensure_no_users_have_.rhosts_files"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:52.020+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/4"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:52.020+07:00"
         start-time="2022-01-05T01:03:51.689+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Linux Custom Object &#34;No User Home Directories Contain .rhost Files&#34;"
                    negated="false"
                    ns="unix"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806792"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806792"
                    type="file_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="3110">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="path" value="/home/sanh"/>
             <cis:evidence_item_pk_field name="filename" value=".rhost"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806792"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.15 Ensure all groups in /etc/passwd exist in /etc/group

Description:

Over time, system administration errors and changes can lead to groups being defined in /etc/passwd but not in /etc/group .

Groups defined in the /etc/passwd file but not in the /etc/group file pose a threat to system security since group permissions are not properly managed.

Analyze the output of the Audit step above and perform the appropriate action to correct any discrepancies found.

Linux Custom Object "All Groups In /etc/passwd Exist In /etc/group" -- More
CIS-CAT expected every collected text file content item to exist on the target system, and found 39 items.
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found
File: / exists
Pattern:
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.15_Ensure_all_groups_in_etcpasswd_exist_in_etcgroup"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:52.386+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/7"
system="http://cisecurity.org/20-cc/v7.0"/>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16/subcontrol/8"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:52.386+07:00"
         start-time="2022-01-05T01:03:52.127+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="all_exist"
                    comment="Linux Custom Object &#34;All Groups In /etc/passwd Exist In /etc/group&#34;"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806799"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806799"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="3111">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="daemon"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3112">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="bin"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3113">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sys"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3114">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="games"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3115">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="man"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3116">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="lp"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3117">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="mail"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3118">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="news"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3119">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="uucp"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3120">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="proxy"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3121">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="www-data"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3122">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="backup"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3123">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="list"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3124">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="irc"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3125">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gnats"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3126">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="nobody"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3127">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="systemd-network"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3128">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="systemd-resolve"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3129">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="syslog"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3130">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="messagebus"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3131">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="_apt"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3132">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="uuidd"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3133">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="avahi-autoipd"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3134">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="usbmux"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3135">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="dnsmasq"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3136">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="rtkit"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3137">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="speech-dispatcher"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3138">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="whoopsie"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3139">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="kernoops"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3140">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="saned"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3141">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="pulse"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3142">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="avahi"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3143">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="colord"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3144">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="hplip"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3145">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="geoclue"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3146">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gnome-initial-setup"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3147">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="gdm"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3148">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="sanh"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
       <cis:evidence_item itemref="3149">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="username" value="cups-pk-helper"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806799"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:
  • http://cisecurity.org/20-cc/v7.0:
  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.16 Ensure no duplicate UIDs exist

Description:

Although the useradd program will not let you create a duplicate User ID (UID), it is possible for an administrator to manually edit the /etc/passwd file and change the UID field.

Users must be assigned unique UIDs for accountability and to ensure appropriate access protections.

Based on the results of the audit script, establish unique UIDs and review all files owned by the shared UIDs to determine which UID they are supposed to belong to.

Linux Custom Object "Check For Duplicate UIDs" -- More
CIS-CAT Expected... CIS-CAT Collected...
the variable's value to be set to 41 41

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.16_Ensure_no_duplicate_UIDs_exist"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:52.782+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:52.782+07:00"
         start-time="2022-01-05T01:03:52.444+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Linux Custom Object &#34;Check For Duplicate UIDs&#34;"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806803"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806803"
                    type="variable_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806803">
       <cis:evidence_item itemref="3192">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="var_ref"
                                         value="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806803"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="41" dt="int" ev="41" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806803"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.17 Ensure no duplicate GIDs exist

Description:

Although the groupadd program will not let you create a duplicate Group ID (GID), it is possible for an administrator to manually edit the /etc/group file and change the GID field.

User groups must be assigned unique GIDs for accountability and to ensure appropriate access protections.

Based on the results of the audit script, establish unique GIDs and review all files owned by the shared GID to determine which group they are supposed to belong to.

Linux Custom Object "Check For Duplicate GIDs" -- More
CIS-CAT Expected... CIS-CAT Collected...
the variable's value to be set to 66 66

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.17_Ensure_no_duplicate_GIDs_exist"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:52.852+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:52.852+07:00"
         start-time="2022-01-05T01:03:52.839+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Linux Custom Object &#34;Check For Duplicate GIDs&#34;"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806809"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806809"
                    type="variable_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806809">
       <cis:evidence_item itemref="3261">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="var_ref"
                                         value="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806809"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="66" dt="int" ev="66" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806809"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.18 Ensure no duplicate user names exist

Description:

Although the useradd program will not let you create a duplicate user name, it is possible for an administrator to manually edit the /etc/passwd file and change the user name.

If a user is assigned a duplicate user name, it will create and have access to files with the first UID for that username in /etc/passwd . For example, if "test4" has a UID of 1000 and a subsequent "test4" entry has a UID of 2000, logging in as "test4" will use UID 1000. Effectively, the UID is shared, which is a security problem.

Based on the results of the audit script, establish unique user names for the users. File ownerships will automatically reflect the change as long as the users have unique UIDs.

Linux Custom Object "Check For Duplicate User Names" -- More
CIS-CAT Expected... CIS-CAT Collected...
the variable's value to be set to 41 41

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.18_Ensure_no_duplicate_user_names_exist"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:52.920+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:52.920+07:00"
         start-time="2022-01-05T01:03:52.912+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Linux Custom Object &#34;Check For Duplicate User Names&#34;"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806812"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806812"
                    type="variable_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806812">
       <cis:evidence_item itemref="3305">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="var_ref"
                                         value="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806812"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="41" dt="int" ev="41" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806812"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.19 Ensure no duplicate group names exist

Description:

Although the groupadd program will not let you create a duplicate group name, it is possible for an administrator to manually edit the /etc/group file and change the group name.

If a group is assigned a duplicate group name, it will create and have access to files with the first GID for that group in /etc/group . Effectively, the GID is shared, which is a security problem.

Based on the results of the audit script, establish unique names for the user groups. File group ownerships will automatically reflect the change as long as the groups have unique GIDs.

Linux Custom Object "Check For Duplicate Group Names" -- More
CIS-CAT Expected... CIS-CAT Collected...
the variable's value to be set to 66 66

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.19_Ensure_no_duplicate_group_names_exist"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:52.973+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/16"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:52.973+07:00"
         start-time="2022-01-05T01:03:52.963+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="at_least_one_exists"
                    comment="Linux Custom Object &#34;Check For Duplicate Group Names&#34;"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806816"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806816"
                    type="variable_test">
    <cis:evidence_state steref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:ste:806816">
       <cis:evidence_item itemref="3374">
          <cis:evidence_item_pk status="exists">
             <cis:evidence_item_pk_field name="var_ref"
                                         value="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:var:806816"/>
          </cis:evidence_item_pk>
          <cis:evidence_field cv="66" dt="int" ev="66" name="value" op="equals" result="true"/>
       </cis:evidence_item>
    </cis:evidence_state>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806816"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0:

Pass

6.2.20 Ensure shadow group is empty

Description:

The shadow group allows system programs which require access the ability to read the /etc/shadow file. No users should be assigned to the shadow group.

Any users assigned to the shadow group would be granted read access to the /etc/shadow file. If attackers can gain read access to the /etc/shadow file, they can easily run a password cracking program against the hashed passwords to break them. Other security information that is stored in the /etc/shadow file (such as expiration) could also be useful to subvert additional user accounts.

Remove all users from the shadow group, and change the primary group of any users with shadow as their primary group.

Linux Custom Object "Shadow Group is Empty" -- More
CIS-CAT did not expect to collect any matching text file content items, and found 0 items.
File: /etc/group does not exist
Pattern: ^shadow:[^:]*:[^:]*:[^:]+$
Match Text: No match found

Show Rule Result XML
<rule-result xmlns="http://checklists.nist.gov/xccdf/1.2"
  xmlns:ae="http://benchmarks.cisecurity.org/ae/0.5"
  xmlns:cc6="http://cisecurity.org/20-cc/v6.1"
  xmlns:cc7="http://cisecurity.org/20-cc/v7.0"
  xmlns:ciscf="https://benchmarks.cisecurity.org/ciscf/1.0"
  xmlns:notes="http://benchmarks.cisecurity.org/notes"
  xmlns:xccdf="http://checklists.nist.gov/xccdf/1.2"
  xmlns:xhtml="http://www.w3.org/1999/xhtml"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  idref="xccdf_org.cisecurity.benchmarks_rule_6.2.20_Ensure_shadow_group_is_empty"
  role="full"
  severity="unknown"
  time="2022-01-05T01:03:53.048+07:00"
  version="1"
  weight="1.0">
<result>pass</result>
<ident cc7:controlURI="http://cisecurity.org/20-cc/v7.0/control/14/subcontrol/6"
system="http://cisecurity.org/20-cc/v7.0"/>
<metadata>
<cis:evidence xmlns:cis="http://benchmarks.cisecurity.org/evidence/1.0"
         end-time="2022-01-05T01:03:53.049+07:00"
         start-time="2022-01-05T01:03:53.047+07:00">
<cis:and>
 <cis:evidence_test check="all" check_existence="none_exist"
                    comment="Linux Custom Object &#34;Shadow Group is Empty&#34;"
                    negated="false"
                    ns="independent"
                    objref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:obj:806821"
                    result="true"
                    testref="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:tst:806821"
                    type="textfilecontent54_test">
    <cis:evidence_object>
       <cis:evidence_item itemref="3376">
          <cis:evidence_item_pk status="does not exist">
             <cis:evidence_item_pk_field name="filepath" value="/etc/group"/>
             <cis:evidence_item_pk_field name="path" value="/etc"/>
             <cis:evidence_item_pk_field name="filename" value="group"/>
             <cis:evidence_item_pk_field name="pattern" value="^shadow:[^:]*:[^:]*:[^:]+$"/>
          </cis:evidence_item_pk>
       </cis:evidence_item>
    </cis:evidence_object>
 </cis:evidence_test>
</cis:and>
</cis:evidence>
</metadata>
<complex-check operator="AND">
<check system="http://oval.mitre.org/XMLSchema/oval-definitions-5">
<check-content-ref href="CIS_Ubuntu_Linux_18.04_LTS_Benchmark_v2.0.1-oval.xml"
                 name="oval:org.cisecurity.benchmarks.canonical_ubuntu_linux_18:def:806821"/>
</check>
</complex-check>
</rule-result>

References:

  • http://cisecurity.org/20-cc/v7.0: